Hello,
There are two ways to modify the text color and the background color.
The first way: Open Styles.xaml
in Recourses/Styles folder, then add the FlyoutItemLabelStyle
for the Shell, for example
<Style TargetType="Label"
Class="FlyoutItemLabelStyle">
<Setter Property="TextColor"
Value="Yellow" />
<Setter Property="BackgroundColor" Value="Green"> </Setter>
</Style>
The other way is to define the menuitem appearance, then you can set the color, for example
<Shell.MenuItemTemplate>
<DataTemplate>
<Grid BackgroundColor="Purple" ColumnDefinitions="0.2*,0.8*">
<Image Source="{Binding Icon}"
Margin="5"
HeightRequest="45" />
<Label Grid.Column="1"
Text="{Binding Text}"
FontAttributes="Italic"
TextColor="Red"
VerticalTextAlignment="Center"
BackgroundColor="Yellow"/>
</Grid>
</DataTemplate>
</Shell.MenuItemTemplate>
For more details, you can refer to .NET MAUI Shell flyout - .NET MAUI | Microsoft Learn
Best Regards,
Wenyan Zhang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.