diff options
author | Rui Marinho <me@ruimarinho.net> | 2016-05-26 20:05:14 +0100 |
---|---|---|
committer | Jason Smith <jason.smith@xamarin.com> | 2016-05-26 12:05:14 -0700 |
commit | 349336dbf12fb158f7731ece7fb1524cb1f5808a (patch) | |
tree | 5f9f70d20b6ba4aaf0a3a17040381f18e16f8783 | |
parent | c502f47980882e61402f77a55236653a22f706ab (diff) | |
download | xamarin-forms-349336dbf12fb158f7731ece7fb1524cb1f5808a.tar.gz xamarin-forms-349336dbf12fb158f7731ece7fb1524cb1f5808a.tar.bz2 xamarin-forms-349336dbf12fb158f7731ece7fb1524cb1f5808a.zip |
Fix margins on ViewCell (#189)
* [iOS] Set the frame of a cell NativeView using the calculated positions and size
* [UWP] Make wrapper of a ViewCell respect margins
-rw-r--r-- | Xamarin.Forms.Platform.WinRT/ViewToRendererConverter.cs | 2 | ||||
-rw-r--r-- | Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/ViewToRendererConverter.cs b/Xamarin.Forms.Platform.WinRT/ViewToRendererConverter.cs index 1c078d93..2d8a4f90 100644 --- a/Xamarin.Forms.Platform.WinRT/ViewToRendererConverter.cs +++ b/Xamarin.Forms.Platform.WinRT/ViewToRendererConverter.cs @@ -66,7 +66,7 @@ namespace Xamarin.Forms.Platform.WinRT _view.IsInNativeLayout = false; var content = Content as FrameworkElement; - content.Arrange(new Rect(0, 0, finalSize.Width, finalSize.Height)); + content.Arrange(new Rect(_view.X, _view.Y, _view.Width, _view.Height)); return finalSize; } diff --git a/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs b/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs index 54f3c1e0..9493c8fb 100644 --- a/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs +++ b/Xamarin.Forms.Platform.iOS/Cells/ViewCellRenderer.cs @@ -91,15 +91,16 @@ namespace Xamarin.Forms.Platform.iOS base.LayoutSubviews(); var contentFrame = ContentView.Frame; + var view = ViewCell.View; - Layout.LayoutChildIntoBoundingRegion(ViewCell.View, contentFrame.ToRectangle()); + Layout.LayoutChildIntoBoundingRegion(view, contentFrame.ToRectangle()); if (_rendererRef == null) return; IVisualElementRenderer renderer; if (_rendererRef.TryGetTarget(out renderer)) - renderer.NativeView.Frame = contentFrame; + renderer.NativeView.Frame = view.Bounds.ToRectangleF(); } public override SizeF SizeThatFits(SizeF size) |