Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using NUnit.Framework;
#if ANDROID || IOS
using NUnit.Framework;
using UITest.Appium;
using UITest.Core;

Expand All @@ -22,7 +23,8 @@ public void ScrollViewShouldWorkInRTL()
App.ScrollLeft("RTLScrollView");
App.ScrollRight("LTRScrollView");
}
App.WaitForElement("Tab5RTL");
App.WaitForElement("Tab5LTR");
Assert.That(App.FindElement("Tab5LTR").GetRect().X, Is.LessThan(App.FindElement("RTLScrollView").GetRect().Width * 1.2f));
Assert.That(App.FindElement("Tab5RTL").GetRect().X, Is.GreaterThan(-50f));
}
}
}
#endif
4 changes: 2 additions & 2 deletions src/Core/src/Platform/iOS/MauiScrollView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ public override void LayoutSubviews()
// For Right-To-Left (RTL) layouts, we need to adjust the content arrangement and offset
// to ensure the content is correctly aligned and scrolled. This involves a second layout
// arrangement with an adjusted starting point and recalculating the content offset.
if (_previousEffectiveUserInterfaceLayoutDirection is not null && _previousEffectiveUserInterfaceLayoutDirection != EffectiveUserInterfaceLayoutDirection)
if (_previousEffectiveUserInterfaceLayoutDirection != EffectiveUserInterfaceLayoutDirection)
{
if (EffectiveUserInterfaceLayoutDirection == UIUserInterfaceLayoutDirection.RightToLeft)
{
var horizontalOffset = contentSize.Width - crossPlatformBounds.Width;
crossPlatformLayout.CrossPlatformArrange(new Rect(new Point(-horizontalOffset, 0), crossPlatformBounds));
ContentOffset = new CGPoint(horizontalOffset, 0);
}
else
else if(_previousEffectiveUserInterfaceLayoutDirection is not null)
Comment thread
PureWeen marked this conversation as resolved.
{
ContentOffset = new CGPoint(0, ContentOffset.Y);
}
Expand Down
Loading