1

I'm using an absolute layout in my application and I want, for each element in the layout, a specific position and size depending the platform.

I find an other question where it was said that to use

<Label.AbsoluteLayout.LayoutBounds>

But it my case, the AbsoluteLayout property doesn't exist if I write it between <...>

So, It is possible to set the property LayoutBounds by platform ?

I'm using Xamarin 4.4.

Thanks for your help

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Alexandre S.
  • 522
  • 2
  • 5
  • 24

1 Answers1

3

AbsoluteLayout.LayoutBounds="{OnPlatform Android='0,0,1,1', iOS='0,0,.5,.5'}"

I believe that should work, but i haven't tested it. You just need to use OnPlatform and provide the desired values for each platform you want to cover.

Edit: Just tested this. It works.

ottermatic
  • 992
  • 6
  • 10