Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
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

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Are you using two layout for this app like portrait and landscape?

If this is the case, immediately delete the landscape file OR add the same bottom navigation with very same id. Because I was facing on. this issue lady and finally I resolved it in this way.

over 4 years ago · Santiago Trujillo Report

0

If we add it in the onCreate() methods it will works fine and able to hide the tab with the code

bottomNavigation.getMenu().removeItem(R.id.schedulers)
over 4 years ago · Santiago Trujillo Report

0

Just use listener on navController if using nav component

navController.addOnDestinationChangedListener { _, destination, _ ->
   if(destination.id == R.id.full_screen_destination) {
       toolbar.visibility = View.GONE
       bottomNavigationView.visibility = View.GONE
   } else {
       toolbar.visibility = View.VISIBLE
       bottomNavigationView.visibility = View.VISIBLE
   }
}

Refrence

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!