Closed rohanstomar11 closed 3 months ago
@gre Please help if possible. Thank you.
@rohanstomar11
I was facing similar issue. When I was trying to capture the content of ScrollView, non screen area content was showing as blank even though I set snapshotContentContainer: true
for captureRef function.
So I added <View collapsable="false">
inside <ScrollView>
like below. It started capturing full content.
<ScrollView contentInsetAdjustmentBehavior="automatic">
<View style={{ flex: 1}} collapsable={false} ref={viewRef} >
// Content goes here
</View>
</ScrollView>
const uri = await captureRef(viewRef, {
fileName: `sample-file`,
format: "jpg",
quality: 0.8,
})
@rohanstomar11 I was facing similar issue. When I was trying to capture the content of ScrollView, non screen area content was showing as blank even though I set
snapshotContentContainer: true
for captureRef function.So I added
<View collapsable="false">
inside<ScrollView>
like below. It started capturing full content.<ScrollView contentInsetAdjustmentBehavior="automatic"> <View style={{ flex: 1}} collapsable={false} ref={viewRef} > // Content goes here </View> </ScrollView>
const uri = await captureRef(viewRef, { fileName: `sample-file`, format: "jpg", quality: 0.8, })
Thanks @rrameshbtech. It worked for me.
Although How It worked for me was:
1.) I transferred the viewShotRef object from ScrollView to the child View Inside it
2.) I had to remove the snapshotContentContainer: true
from the captureScreenshot function.
Image is coming partially black on Android when used in conjunction with ScrollView
Version: 0.72.4
Platform: Android
Expected behavior
When Image is generated of the ScrollView Component, The image should take the actual height of the scrollview, and generate the component as Image.
Actual behavior
Image is taking actual height of the scrollview but the image is partially coming black.
Steps to reproduce the behavior
I have attached a reproducible sample on this repo: https://github.com/rohanstomar11/view-shot.git. Also, added the resultant image at the bottom.
Sample Code:
Resultant Image