Forum Xamarin.Forms

How can I use Multiple AbsoluteLayoutFlags?

AndrewBerzleyAndrewBerzley USMember ✭✭
edited April 2015 in Xamarin.Forms

My goal: a single button full width at the bottom of the screen.

Here is my code example:
Button button = new Button { Text = "Example" }; AbsoluteLayout.SetLayoutFlags (button, AbsoluteLayoutFlags.WidthProportional); AbsoluteLayout.SetLayoutFlags (button, AbsoluteLayoutFlags.PositionProportional); AbsoluteLayout.SetLayoutBounds (button, new Rectangle (0f, 1f, 1, AbsoluteLayout.AutoSize));

Currently if I use just WidthProportional I get a full width button. If I use just PositionProportional I get the button at the bottom of the page. Using both as I have it above only uses the most recently applied flag.

I've found no examples online of how to apply multiple flags. I wouldn't be surprised if I'm going at this task the wrong way all together.

Best Answer

Answers

  • AndrewBerzleyAndrewBerzley USMember ✭✭

    Thank you @adamkemp. I knew it had to be something simple I wasn't grasping.

Sign In or Register to comment.