[iOS] ScrollView content offset RTL - fix#29469
Merged
mattleibow merged 2 commits intodotnet:inflight/currentfrom May 15, 2025
Merged
[iOS] ScrollView content offset RTL - fix#29469mattleibow merged 2 commits intodotnet:inflight/currentfrom
mattleibow merged 2 commits intodotnet:inflight/currentfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses an RTL (right-to-left) scrolling offset issue in iOS by introducing a conditional layout rearrangement when the UI direction is RTL.
- Added conditional block in LayoutSubviews to adjust content arrangement and offset based on EffectiveUserInterfaceLayoutDirection
- Sets the content offset to ensure correct scrolling behavior in RTL environments
Comment on lines
+56
to
+60
| crossPlatformLayout.CrossPlatformArrange(new Rect(new Point(crossPlatformBounds.Width - contentSize.Width, 0), crossPlatformBounds)); | ||
| SetContentOffset(new CGPoint(contentSize.Width - crossPlatformBounds.Width, 0), false); |
There was a problem hiding this comment.
[nitpick] Consider extracting the expression 'crossPlatformBounds.Width - contentSize.Width' into a variable to avoid duplication and enhance readability.
Suggested change
| crossPlatformLayout.CrossPlatformArrange(new Rect(new Point(crossPlatformBounds.Width - contentSize.Width, 0), crossPlatformBounds)); | |
| SetContentOffset(new CGPoint(contentSize.Width - crossPlatformBounds.Width, 0), false); | |
| var horizontalOffset = crossPlatformBounds.Width - contentSize.Width; | |
| crossPlatformLayout.CrossPlatformArrange(new Rect(new Point(horizontalOffset, 0), crossPlatformBounds)); | |
| SetContentOffset(new CGPoint(-horizontalOffset, 0), false); |
5e146c9 to
0a3f75a
Compare
mattleibow
requested changes
May 14, 2025
Member
mattleibow
left a comment
There was a problem hiding this comment.
I wish there was a "Asking a question" button, but I have to pick an option or the bots bug me to pick something.
But, it appears the layout for RTL uses the right of the visible area, so a negative left offset will move the content or move the start and show the content?
Member
|
/rebase |
mattleibow
approved these changes
May 15, 2025
PureWeen
pushed a commit
that referenced
this pull request
May 21, 2025
* [iOS] ScrollView content offset RTL fix * Added a UITest
PureWeen
pushed a commit
that referenced
this pull request
May 21, 2025
* [iOS] ScrollView content offset RTL fix * Added a UITest
github-actions Bot
pushed a commit
that referenced
this pull request
May 22, 2025
* [iOS] ScrollView content offset RTL fix * Added a UITest
github-actions Bot
pushed a commit
that referenced
this pull request
May 30, 2025
* [iOS] ScrollView content offset RTL fix * Added a UITest
github-actions Bot
pushed a commit
that referenced
this pull request
May 30, 2025
* [iOS] ScrollView content offset RTL fix * Added a UITest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Are you waiting for the changes in this PR to be merged?
It would be very helpful if you could test the resulting artifacts from this PR and let us know in a comment if this change resolves your issue. Thank you!
Issues Fixed
Fixes #29458
Screen.Recording.2025-05-13.at.15.46.46.mov
Screen.Recording.2025-05-13.at.15.45.31.mov