I need to remove Flyout icon image in my Xamarin.Forms app and to move title to left so that icon space also does not appear.
Please help to achieve it.
You can use DataTemplate
to achieve this.
Take sample Xaminals for example, if we change the code of AppShell.xaml
as follows:
1.change Template for each FlyoutItem and remove property Icon
of FlyoutItem
<Shell.ItemTemplate> <DataTemplate> <Label Text="{Binding Title}" Margin="0,0,10,0" VerticalTextAlignment="Center" /> </DataTemplate> </Shell.ItemTemplate>
2.change Template for each MenuItem as follows
<Shell.MenuItemTemplate> <DataTemplate> <Label Margin="0,5,10,5" Text="{Binding Text}" FontAttributes="Italic" VerticalTextAlignment="Center" /> </DataTemplate> </Shell.MenuItemTemplate>
Then the result is:
Note: Of course, you can customize the DataTemplate according to your requirement.
Answers
You can use
DataTemplate
to achieve this.Take sample Xaminals for example, if we change the code of
AppShell.xaml
as follows:1.change Template for each FlyoutItem and remove property
Icon
of FlyoutItem2.change Template for each MenuItem as follows
Then the result is:

Note: Of course, you can customize the DataTemplate according to your requirement.