I am trying to change the default height of menuItem in Xamrian Froms, but I am unable to change it.
Asked
Active
Viewed 1,429 times
2 Answers
1
This is done with DataTemplate, ie
<!-- Template each FlyoutItem -->
<Shell.ItemTemplate>
<DataTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.2*" />
<ColumnDefinition Width="0.8*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="3*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Image Grid.Row="1" Grid.Column="0" Source="{Binding Icon}"
Margin="5"/>
<Label Grid.Row="1" Grid.Column="1"
Text="{Binding Title}" TextColor="SkyBlue"
FontAttributes="Italic"
VerticalTextAlignment="Center" />
</Grid>
</DataTemplate>
</Shell.ItemTemplate>
<!-- Template each MenuItem -->
<Shell.MenuItemTemplate>
<DataTemplate>
<Grid HeightRequest="80">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.2*" />
<ColumnDefinition Width="0.8*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="3*"/>
</Grid.RowDefinitions>
<Image Grid.Row="1" Grid.Column="0" Source="{Binding Icon}"
Margin="5"/>
<Label Grid.Row="1" Grid.Column="1"
Text="{Binding Text}"
FontAttributes="Italic"
VerticalTextAlignment="Center" />
</Grid>
</DataTemplate>
</Shell.MenuItemTemplate>

Knipper
- 21
- 3
1
I was surprised hearing that my solution did not work for you.
I had a closer look and did some more testing using my Android phone and also using my iphone.
If you want, have a look at my demo app source code which I created for this test:
https://github.com/wzdr/DemoMenuHeight
Sadly, I noticed that the behavior on the iphone is different and in fact setting the height does not seem to work at all on iOS. On Android it's fine though.
Android and iphone screenshots below. Android Flyout

Knipper
- 21
- 3