Reputation: 3681
I have 2 rows inside a grid, for the first row has a fixed size. I am trying to apply the OnIdiom
feature here. Tried like below:
<Grid.RowDefinitions>
<RowDefinition>
<RowDefinition.Height>
<OnIdiom x:TypeArguments="x:Double">
<OnIdiom.Phone>30</OnIdiom.Phone>
<OnIdiom.Tablet>60</OnIdiom.Tablet>
</OnIdiom>
</RowDefinition.Height>
</RowDefinition>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
But getting following error on error list:
No property, bindable property, or event found for 'Height', or mismatching type between value and property.
What is the correct format of RowDefinition height OnIdiom property?
Upvotes: 2
Views: 829
Reputation: 588
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="{OnIdiom Phone=30, Tablet=60}" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<StackLayout
Grid.Row="0"
BackgroundColor="Blue"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand" />
</Grid>
Upvotes: 1