How to dynamically hide a menu item in BottomNavigationView?

后端 未结 9 1510
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-30 20:04

I want to hide a menu item of BottomNavigationView dynamically based on some conditions. I tried the following but it is not working.

mBottomNavigationView.g         


        
9条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-30 20:46

    setVisibility should work for you. FYI, below example is in kotlin.

    bottomNavigationView.menu.findItem(R.id.navigation_item_two).isVisible = false
    

提交回复
热议问题