Forum Xamarin.Forms

Shell Tab Bar Customization

vinay_inavoluvinay_inavolu SGUniversity ✭✭

Hi

i want to implement Customization to TabBar in Shell. Want to apply increasing Height, ICON Size, and ICON Color.

Tint Color defined in Shell Xaml. )

For TabBar height, Tried in Android with Shell renderer. Managed to increase height but TabBartitle color is gone(Showing default Blue color)

public void SetAppearance(BottomNavigationView bottomView, IShellAppearanceElement appearance)
{

     var parameters = bottomView.LayoutParameters;
       parameters.Height = 200;
        bottomView.LayoutParameters = parameters;
    }

Please advice.

Answers

  • JarvanJarvan Member, Xamarin Team Xamurai

    Managed to increase height but TabBartitle color is gone(Showing default Blue color)

    What did you set the TargetType for in AppShell.xaml? Try to add the command to consume the color style for TabBar.

    Check the code:

    <Shell.Resources>
        <ResourceDictionary>
            <Color x:Key="NavigationPrimary">#2196F3</Color>
            <Style x:Key="BaseStyle" TargetType="Element">
                ...
                <Setter Property="Shell.TabBarTitleColor" Value="Red"/>
            </Style>
            <Style TargetType="TabBar" BasedOn="{StaticResource BaseStyle}" />
        </ResourceDictionary>
    </Shell.Resources>
    
Sign In or Register to comment.