Sunday, 9 January 2022

How can I hide a bottom tab in the bottom navigation in android. (Landscape mode failed to hide the tab)

I need to hide center bottom tab in the bottom navigation while launching the app. Here I have tried to remove the tab. It worked in potrait mode, But in the landscape mode, to hide the tab bar in UI.

bottomNavigation.getMenu().removeItem(R.id.schedulers);



<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/"
        android:icon="@drawable/ic_bottom"
        android:title="@string/all"/>

    <item
        android:id="@+id/tab"
        android:icon="@drawable/ic_bottom"
        android:title="@string/my"/>

    <item
        android:id="@+id/schedulers"
        android:icon="@drawable/schedulers"
        android:title="@string/schedulers"/>

    <item
        android:id="@+id/tab"
        android:icon="@drawable/ic_bottom"
        android:title="@string/kkk"/>
    <item
        android:id="@+id/tab"
        android:icon="@drawable/ic_bottom"
        android:title="@string/kkkk"/>
</menu>

enter image description here



from How can I hide a bottom tab in the bottom navigation in android. (Landscape mode failed to hide the tab)

No comments:

Post a Comment