How to dynamically hide a menu item in BottomNavigationView?

后端 未结 9 1546
佛祖请我去吃肉
佛祖请我去吃肉 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:44

    mBottomNavigationView.getMenu().removeItem(R.id.item_name);
    

    removeItem does the trick. Not sure why setVisible method is not working.

提交回复
热议问题