Home > Software engineering >  Xamarin Forms Grid RowDefinitions support OnIdiom on the same line as Grid is defined?
Xamarin Forms Grid RowDefinitions support OnIdiom on the same line as Grid is defined?

Time:10-10

There is a post on stack overflow which is very similar but doesn't actually ask about the new way of defining RowDefinitions. Similar Question

What is the correct format for Idiom using this row definition method...

<Grid BackgroundColor="LightGreen"
      Margin="0, 10 ,0 ,10"
      RowDefinitions="{OnIdiom ?????}, *, 100">
</Grid>

Is it possible to set Idiom using inline property definitions or do I actually have to create RowDefinitions as shown in Similar Question?

Thanks in advance.

CodePudding user response:

If you want Platform Specific or Idiom Specific Row definitions there's only one way to do it through XAML,

<Grid.RowDefinitions>
   <RowDefinition Height="{OnIdiom Phone=30, Tablet=60}" />
   <RowDefinition Height="{OnPlatform Android=40, iOS=35}" />
</Grid.RowDefinitions>

Hope this helps

  • Related