How can I use styles in tabbed pages?

Platform: .NET MAUI| Category: Controls

You can customize the tabbed pages by creating new styles in TabbedPage.Resources and define styles to the tabs.

XAML

<TabbedPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
            xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
            xmlns:local="clr-namespace:MultiseletionSample"
            x:Class="MultiseletionSample.MainPage">
    
    <TabbedPage.Resources>
        <Style TargetType="local:NewPage1" x:Key="style">
            <Setter Property="BackgroundColor" Value="Blue" />
        </Style>
    </TabbedPage.Resources>
    <local:NewPage1 Title="New" Style="{StaticResource style}"/>
    <local:NewPage2 Title="New" Style="{StaticResource style}"/>
    <local:NewPage3 Title="New" Style="{StaticResource style}"/>
    
</TabbedPage>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.