-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
add iOS support for progressViewOffset on RefreshControl #30117
Conversation
|
Base commit: fd9787e |
Base commit: fd9787e |
@@ -160,6 +163,11 @@ - (void)setCurrentRefreshingState:(BOOL)refreshing | |||
_currentRefreshingStateTimestamp = _currentRefreshingStateClock++; | |||
} | |||
|
|||
- (void)setProgressViewOffset:(float)offset | |||
{ | |||
_progressViewOffset = offset / UIScreen.mainScreen.scale; |
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.
why is this needed? Isn't offset
already in points?
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.
Without the scaling, the offset using CGRectOffset
didn't match up with the android progressViewOffset
Hello @Taylor123, thank you for the PR. Could you post a screenshot where we can see the effect of progressViewOffset property? Is Do you think we should add the use of Also the documentation will need to be updated here: https://github.com/facebook/react-native-website/blob/master/docs/refreshcontrol.md |
I don't have much time to dedicate to this at the moment (maybe I will in the near future). I tried quickly reimplementing with transform, but can't get the transform to work. Not sure if there is some quirk with the UIControl in the scrollview or what. Tried this as well as updating the transform in
If i can find the time to figure out why the transform isn't working, then i'll post a screenshot with an updated PR. |
@Taylor123 Are you still working on this? Are you open to me taking up the mantle? I've tried self.transform as well, and of course in this case the offset needs to be negated, but there seems to be some other view that ends up occluding or clipping the RefreshControl. I've had much more luck with adapting your original solution - I extracted the bit that sets the offset frame into a helper function, and I've identified a few places where it needs to be called (mostly because the parent class's methods occasionally re-calculate the frame). I'm happy to either provide a patch, or open up a new PR, but I'm using it now in a production app and it was just validated by our QA. cc @sammy-SC |
@davidbiedenbach feel free to contribute however is easiest to you! My requirements changed, so I no longer needed the fix for this. Glad you were able to get a better fix. If you open up a new PR, just tag me here so i can close this one |
@Taylor123 @sammy-SC New PR is here: #30737 Thanks! |
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This PR was closed because it has been stalled for 7 days with no activity. |
Summary
fix #10718
Add
progressViewOffset
support toRefreshControl
in iOS for better feature parity with Android.Changelog
[iOS] [Fix] - Add
progressViewOffset
support toRefreshControl
in iOS for better feature parity with Android.Test Plan
Tested locally