Comments (16)
I a have the same problem. Canvas in webview is blank. Setting android:hardwareAccelerated="false" works, but then you don't get the acceleration and the app is slow.
Is there any other way to solve this issue? @Rice-M how did you solved it?
from react-native-view-shot.
is Android WebView. and, I thinks you don't mean what i say .
the WebView snapshot is work ,but the canvas is blank.
from react-native-view-shot.
@gre yes ,is in . maybe i expressions has worng. i will fork react-native-view-shot-example and code the problem
from react-native-view-shot.
but, if move the webview element after <View ref="form"></View>
, is not blank.
like this:
<View
ref="form"
style={styles.form}>
<View style={styles.btns}>
<Btn label="😻 Reset" onPress={() => this.setState({ previewSource: catsSource })} />
<Btn label="📷 Head Section" onPress={this.snapshot("header")} />
<Btn label="📷 Form" onPress={this.snapshot("form")} />
<Btn label="📷 Experimental Section" onPress={this.snapshot("complex")} />
<Btn label="📷 All (ScrollView)" onPress={this.snapshot("full")} />
<Btn label="📷 GL React" onPress={this.snapshot("gl")} />
<Btn label="📷 MapView" onPress={this.snapshot("mapview")} />
<Btn label="📷 WebView" onPress={this.snapshot("webview")} />
<Btn label="📷 Video" onPress={this.snapshot("video")} />
<Btn label="📷 Empty View (should crash)" onPress={this.snapshot("empty")} />
</View>
<View
ref="webview"
collapsable={false}
style={{ width: 300, height: 500 }}>
<WebView
source={require('./assets/cavans.html')}
/>
</View>
from react-native-view-shot.
What platform are you developing on?
This is what it says in the docs:
Android WebView:
Only supported by wrapping a parent and snapshotting it.
from react-native-view-shot.
as said in the README here https://github.com/gre/react-native-view-shot#interoperability-table
Android WebView is only supported by wrapping a <View collapsable={false}>
parent and snapshotting it.
for some reason, directly attempting to snapshot the WebView won't work. to avoid this confusion, I might introduce that #48 so you don't have to think about this problem. What do you think?
from react-native-view-shot.
@gre see in https://github.com/manweill/react-native-view-shot-example
from react-native-view-shot.
I've tested your code in a WebView and I can successfully snapshot in Android so maybe this was recently fixed
from react-native-view-shot.
@Manweill Hi, how did you solve this, in my case some canvas in webview can not be captured
from react-native-view-shot.
are you sure the canvas is rendered at the time you capture it?
from react-native-view-shot.
@gre yes, I can see the rendered canvas in the srceen, bug when capture to img some canvas not shown
from react-native-view-shot.
You can see the img1 some section is blank
from react-native-view-shot.
solved?
from react-native-view-shot.
try to set android:hardwareAccelerated="false", it works.
from react-native-view-shot.
hint https://developer.android.com/reference/android/view/PixelCopy
from react-native-view-shot.
Did anyone find a solution for this without setting android:hardwareAccelerated="false"? That is not a real solution right?
I am facing this issue on Android only when capturing a view containing TradingView in a WebView.
@gre Please let me know if I am missing anything.
from react-native-view-shot.
Related Issues (20)
- Sharing to different apps HOT 1
- react-native-view-shot error: failed to capture view snapshot on android with MaskedView from '@react-native-community/masked-view'
- FlatList inside a View HOT 1
- React-native 0.72 requires higher minimum SDK version for windows.
- Getting blank screen when capturing video playing under webview.
- Getting blank screen when capturing video playing under webview. HOT 4
- 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 1
- 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 1
- how to avoid black edges formed after capturing. HOT 1
- Regression in 4.0.0-alpha.2
- In android it does nothing and not showing any error logs. Works fine in iOS HOT 4
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.