Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] On ScrollView, how to take picture all of it, not only visible part? #70

Closed
fuatsengul opened this issue Jun 2, 2017 · 12 comments

Comments

@fuatsengul
Copy link

Hi, I have a long page which user have to scroll down to read all of it. This page is something user want to share on social media, so I need to take a shot whole scrollview content.
So, I've tried to use this package to take the image but it only returns what's visible on screen at the moment, I've also tried snapshotContentContainer option but no luck so far.

@ihor
Copy link

ihor commented Jun 6, 2017

I'm having the same issue. Have you found any solution?

@fuatsengul
Copy link
Author

Sorry, I was working on another part of the app at the moment, please let me know if you find a solution for that. Thanks

@ihor
Copy link

ihor commented Jun 6, 2017

Well, rendering off-screen in a regular View as suggested here #31 works.

@gre
Copy link
Owner

gre commented Jun 6, 2017

mmh yeah so snapshotContentContainer is supposed to solve that. are you screenshoting from the scrollview ref?

@gre
Copy link
Owner

gre commented Jun 7, 2017

maybe there is a bug in the feature #47 (comment)

@ihor
Copy link

ihor commented Jun 7, 2017

I see the same as described in #47. The content is stretched but cut.

@gre
Copy link
Owner

gre commented Jun 8, 2017

I guess the bug is only on iOS, probably around these lines:

if (snapshotContentContainer) {
// Save scroll & frame and set it temporarily to the full content size
savedContentOffset = scrollView.contentOffset;
savedFrame = scrollView.frame;
scrollView.contentOffset = CGPointZero;
scrollView.frame = CGRectMake(0, 0, scrollView.contentSize.width, scrollView.contentSize.height);
}

would you like to provide a PR to fix it? (I have bad connectivity right now in China, this will need to wait 2 more weeks otherwise)

@sachinB94
Copy link

Hey, Any update on this? Testing on iOS simulator, facing the same issue.

@gre
Copy link
Owner

gre commented Jul 26, 2017

do you want to try a fix and submit a PR, otherwise a snippet reproducing the problem would be good, i'm not sure if the bug is reproducible in https://github.com/gre/react-native-view-shot-example already

@gre
Copy link
Owner

gre commented Sep 19, 2017

closing as I can't reproduce it. if you can and want to provide a fix, please provide a PR.

@gre gre closed this as completed Sep 19, 2017
@MiteshJabuani
Copy link

MiteshJabuani commented Sep 26, 2019

scroll view content no of items and capture a single image of the scroll view. get image Like below...
zoGHk

@MiteshJabuani
Copy link

MiteshJabuani commented Sep 27, 2019

scrollview inside flatlist then capture screenshot
<Scrollview
<View
contents....
</View
<Flatlist
.........
/>
</Scrollview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants