How to dynamically hide a menu item in BottomNavigationView?

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

    Try this:

    navView.getMenu().findItem(R.id.your_menu_item_id).setVisible(true);
    navView.getMenu().findItem(R.id.your_menu_item_id).setVisible(false);
    

提交回复
热议问题