Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

202
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda