How to dynamically hide a menu item in BottomNavigationView?

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

    I tried most of solutions but this worked for me,

    For hiding an item dynamically : bottomNavigationView.findViewById(R.id.xyz).setVisibility(View.GONE);

    For making item visible: bottomNavigationView.findViewById(R.id.xyz).setVisibility(View.VISIBLE);

提交回复
热议问题