Comments (10)
@gre Thanks ! setting collapsable={false
} helped me
from react-native-view-shot.
it looks like your ref this.refs.screenshot
is undefined.
You should make sure you don't call takeSnapshot when your view is not yet rendered or has been unmounted.
from react-native-view-shot.
@gre Sorry that was my fault actually. I corrected the refs.
My issue is I am getting this error on Android while it is working on iOS.
'Trying to resolve view with tag 232 which doesn't exist.'
from react-native-view-shot.
You probably fall into one of the caveats of the Android implementation. See https://github.com/gre/react-native-view-shot/blob/master/README.md#caveats
Can you try to set collapsable={false} on the view you snapshot?
Android react-native implementation tends to "collapse" the nested view so most View don't always have a native View.
from react-native-view-shot.
Hi i have the same problem and cant manage to resolve it. This is my code:
<View style={{position:'absolute', right:45}}>
<TouchableOpacity onPress={()=>{
let shareOptions = null;
takeSnapshot(this.screenshot, {
format: "jpeg",
quality: 0.8,
result: "base64"
})
.then(
uri => {
console.log(uri);
shareOptions = {
title: "Nautal",
message: "Hola mundo",
url: uri,
subject: "Share Link" // for email
};
},
error => console.error("Oops, snapshot failed", error)
);
console.log(shareOptions);
//Share.open(shareOptions);
}}>
<View style={[STYLES.circleSecondary, {borderColor:'white', margin:10}]}>
<Icon name="share-alt" size={15} color="white" />
</View>
</TouchableOpacity>
</View>
And i declare the view that i want snapshot of later in code like this:
<View ref={(shot) => { this.screenshot = shot; }} style={[STYLES.subContainer,{paddingTop:5}]}>
When i execute the screenshot code page is already rendered but im getting the error anyway. Any ideas how to solve this?
from react-native-view-shot.
@gerardus1995 as said above, set collapsable={false}
on the View
you snapshot
from react-native-view-shot.
@gerardus1995 can you please share your code i have lot of issues.
from react-native-view-shot.
How do we this in the flat list? I am trying renderRowItem > View dynamic reference but it's showing undefined...Please let me know if any solution...Thanks!
from react-native-view-shot.
This is my flat list code
renderRowItem = (itemData, sectionID, index) => {
Moment.locale('en');
return (
<View collapsable={false} ref={(shot) => { this.screenshot.itemData.item._id = shot; }} >
</View>
)
}
How to capture this particular view?
And if i am capturing flat list all items it's showing blur image that won't work for me.
from react-native-view-shot.
collapsable={false} doent help :/
from react-native-view-shot.
Related Issues (20)
- Image Quality is too low while i am taking view shot of my screen
- White borders when view dimensions are not integers
- Crash error on android HOT 5
- not working on ios RN0.72.4
- newArchEnabled HOT 2
- Viewshot is not capture screen shot of absolute positioned Views/
- Is this package still maintained?, because it doesn't seem to work on android anymore HOT 2
- Run time crash due to use of depricated UI Image apis
- not working on android React-Native 0.7x HOT 1
- In scrollable content when i take a shot end of the content styles not applied example borderRadius and color and border
- Android: Image is coming partially black on Android when used in conjunction with ScrollView! HOT 3
- how to avoid black edges formed after capturing. HOT 3
- Regression in 4.0.0-alpha.2 HOT 1
- In android it does nothing and not showing any error logs. Works fine in iOS HOT 5
- Privacy Manifest file HOT 1
- captureRef webview ref error
- view-shot content will not update when webview changes
- One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts HOT 2
- Need support for android O and above
- The generated screenshot appears blurry on Android devices, as if the resolution is incorrect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-view-shot.