How to programmatically add a submenu item to the new material design android support library

前端 未结 5 1579
时光说笑
时光说笑 2020-11-28 23:26

I am trying to add new menu items to a submenu in the new Material Design drawer panel.



        
5条回答
  •  眼角桃花
    2020-11-29 00:07

    You can add and remove item from navigation view by changing the visibility. Get the item at index and setVisible to true to show and false to hide it.

    MenuItem item = navigationView.getMenu().getItem(3);
    item.setVisible(false);
    

提交回复
热议问题