[forms-devel] Windows Center Crop & Aspect = None

Adam Pedley adam.pedley at gmail.com
Tue May 17 03:25:27 UTC 2016


Following on from Issue 10 - TL;DR; can this change be made as a PR or must
some breaking change protection be added - . Just revising my previous code
as I forgot to accommodate Vertical.

  void UpdateAspect() { Control.Stretch = GetStretch(Element.Aspect); if
(Element.Aspect == Aspect.AspectFill) {
// To match center crop on Android/iOS ImageRenderer
Control.HorizontalAlignment = HorizontalAlignment.Center;
Control.VerticalAlignment = VerticalAlignment.Center; } else {
Control.HorizontalAlignment = HorizontalAlignment.Left; // Default
Control.VerticalAlignment = VerticalAlignment.Top; } }

Second issue is why does Xamarin Forms not have Aspect=None, which would be
translated per platform to:

Windows = None
Android = Matrix
iOS = TopLeft

Can this be added in a PR or was there a reason for omitting it originally?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/forms-devel/attachments/20160517/56e390b7/attachment.html>


More information about the forms-devel mailing list