Skip to content

Commit 6ab75b2

Browse files
authored
Update ViewExtensions.iOS.cs
1 parent 4b14438 commit 6ab75b2

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

ShanedlerSamples/Library/Common/ViewExtensions.iOS.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ internal static void PlatformArrangeHandler(this IViewHandler viewHandler, Rect
233233
return;
234234

235235
var centerX = rect.Center.X;
236-
var destinationWidth = rect.Width;
237236

238237
var parent = platformView.Superview;
239238
if (parent?.EffectiveUserInterfaceLayoutDirection == UIUserInterfaceLayoutDirection.RightToLeft)
@@ -246,17 +245,13 @@ internal static void PlatformArrangeHandler(this IViewHandler viewHandler, Rect
246245
var distanceFromParentCenter = parentCenter - centerX;
247246

248247
// Mirror the center to the other side of the center of the parent
249-
centerX = centerX + (distanceFromParentCenter * 2);
248+
centerX += (distanceFromParentCenter * 2);
250249
}
251250

252251
// We set Center and Bounds rather than Frame because Frame is undefined if the CALayer's transform is
253252
// anything other than the identity (https://developer.apple.com/documentation/uikit/uiview/1622459-transform)
254253
platformView.Center = new CGPoint(centerX, rect.Center.Y);
255-
256-
// The position of Bounds is usually (0,0), but in some cases (e.g., UIScrollView) it's the content offset.
257-
// So just leave it whatever value iOS thinks it should be (adjusted for RTL if appropriate)
258-
var leftEdge = centerX - (destinationWidth / 2);
259-
platformView.Bounds = new CGRect(leftEdge, platformView.Bounds.Y, destinationWidth, rect.Height);
254+
platformView.Bounds = new CGRect(platformView.Bounds.X, platformView.Bounds.Y, rect.Width, rect.Height);
260255

261256
viewHandler.Invoke(nameof(IView.Frame), rect);
262257
}
@@ -316,4 +311,4 @@ static partial void ProcessAutoPackage(IElement element)
316311
}
317312
}
318313
}
319-
#endif
314+
#endif

0 commit comments

Comments
 (0)