How to center horizontally in RelativeLayout?

JasonMichasJasonMichas USMember ✭✭

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.

Sign In or Register to comment.