Search code examples
xamarinmauimaui-community-toolkit

How to add title on top of shell and how change the TabBar size on maui shell?


  1. I try to add title on top of AppShell - i want this title not to change on press the tab.
    how to do it ?
  2. Is it possible to controle the size of the TabBar ?

enter image description here


Solution

    1. Yes, inside AppShell.xaml add <Shell.TitleView>your layout</Shell.TitleView>: https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/shell/pages?view=net-maui-8.0#display-views-in-the-navigation-bar
    2. It's not exposed so you'd probably have to inherit from ShellRenderer and create your own instance of ShellBottomNavViewAppearanceTracker (Android) and ShellTabBarAppearanceTracker (iOS) and access the native controls and modify their height from there. Here's a blogpost from Vladislav Antonyuk showing how to modify it: https://vladislavantonyuk.github.io/articles/Customizing-.NET-MAUI-Shell