Xamarin Forms Shell Android bug Tabbar Tab visibility change and unlabeled tabs

248 views Asked by At

I created a repo on github that reproduce my issue : https://github.com/ArthurFSharp/BugTabBar

The idea is : i want to hide labels in tabs, so for Android i do it in custom renderer using LabelVisibilityMode property :

public class AppTabBarAppearance : ShellBottomNavViewAppearanceTracker
{
    public AppTabBarAppearance(IShellContext context, ShellItem shellItem)
        : base(context, shellItem)
    {
    }

    public override void SetAppearance(BottomNavigationView bottomView, IShellAppearanceElement appearance)
    {
        bottomView.ItemIconSize = 100;
        bottomView.LabelVisibilityMode = LabelVisibilityMode.LabelVisibilityUnlabeled;
        bottomView.Elevation = 0f;
    }
}

It works well.

The problem come when i want to hide or show specific tab in the tabbar :

<Tab
        Title="Browse"
        Icon="icon_feed.png"
        IsVisible="{Binding IsBrowseMenuVisible}" >
        <ShellContent ContentTemplate="{DataTemplate local:ItemsPage}" />
    </Tab>

When IsBrowseMenuVisible property change, depending on its value, it show or hide the Browse Tab item, but the labels in the tabs appear again until when change page.

Like tabbar totally resets when i hide a tab but when i navigate in other tab, the renderer is applied again.

UPDATE : To clarify the issue, here is with pictures:

enter image description here

I arrive in the main page, i check to checkbox to hide the third menu :

enter image description here

It works, BUT we see that labels in tab item are back, and when i navigate to other page, they gone :

enter image description here

0

There are 0 answers