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

RelativeLayout Alignment

$
0
0

I am trying to do a bottom right alignment with a label on a relative layout

        Label status = new Label{ Text = "status", TextColor = Color.White };

        rlFront.Children.Add (status, 
            Constraint.RelativeToParent ((parent) => {
                return parent.Width - (status.Width + 2);
            }),
            Constraint.RelativeToParent ((parent) => {
                return parent.Height - (status.Height + 2);
            }));

But the Height and Width are always -1 as are the requested size.
This seems as thought it should be a simple and basic layout as it was in pre forms days.
What am I missing.
This is an extract of the first Item I need to place
Using a grid is not really an option as the design is based on relative positioning and not nice neat columns and rows.


Viewing all articles
Browse latest Browse all 58056

Trending Articles