-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
fix #10747 (ScrollView rendered incorrectly with RefreshControl) #15033
Conversation
set the y offset to 0, since 0 offset is where we want to be after we hide the refreshControl
Why does it work? |
@shergin I'll try to explain with a couple of screenshots: lightblue is refreshControl, green is listView 1 . note I hardcoded the 2 . The same code after the method finishes. One can see the 60 points of RefreshControl (lightblue), and the next 60 points of ListView (green) from the 120 points of offset 3 . This is how the current master behaves when the 4 . this is the current behavior of master, the call to
5 . when 0 is used for the y offset and |
ping @shergin does this look good enough? |
Ping @shergin @janicduplessis does this look good? |
I am sorry, I have not chance to look at this yet. 😞 |
I think this is fine, makes sense that we should set y content offset to 0. |
Wait a second, we just found in another diff that initial |
@vonovak I am really sorry, but I cannot accept your explanation. 😢 |
@shergin can you point me to such diff? |
See discussion here: And follow up diff: And great article about ScrollView: https://www.objc.io/issues/3-views/scroll-view/ I am not sure, honestly. May be I am wrong here. |
@vonovak I tried to find reviewers for this pull request and wanted to ping them to take another look. However, based on the blame information for the files in this pull request I couldn't find any reviewers. This sometimes happens when the files in the pull request are new or don't exist on master anymore. Is this pull request still relevant? If yes could you please rebase? In case you know who has context on this code feel free to mention them in a comment (one person is fine). Thanks for reading and hope you will continue contributing to the project. |
@shergin / @janicduplessis - Why would it not "end refreshing" on 0? The if statement above the change and comment above that both imply that at the end of refreshing it should no longer be negative. What other valid values are allowed and if so should they just be temporarily stored in beginRefreshing and replaced in endRefreshing? "-scrollView.contentInset.top" doesn't seem to make sense for end offset value... as shown by the bugs it's creating. @vonovak - thanks for repeatedly trying to fix this issue. It's appreciated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shergin is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Summary: set the y offset to 0, since 0 offset is where we want to be after we hide the refreshControl. Tested in emulator with ios 8, 9, 10 and also with section headers. Closes facebook#15033 Differential Revision: D6265930 Pulled By: shergin fbshipit-source-id: b249c4713de68fc6b3a32cee7f995dc352315970
set the y offset to 0, since 0 offset is where we want to be after we hide the refreshControl.
Tested in emulator with ios 8, 9, 10 and also with section headers.