Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

How to center horizontally in RelativeLayout?

$
0
0

Im trying to position a stacklayout centered horizontally in a relativelayout. It seems to center based on the top left corner (0,0), how can I get it to use the center of the stack layout using XAML?

I was hoping for something that looked like this a bit

RelativeLayout.XConstraint="{ConstraintExpression Factor=.5,
                                                                       Type=RelativeToParent,
                                                                       Property=Width,
                                                                       Constant={(stackLayout.Width/2)*-1}"

Thanks.


Viewing all articles
Browse latest Browse all 58056

Trending Articles