Navigation Drawer menu items selected within different groups

前端 未结 5 1119
南笙
南笙 2021-02-13 11:44

I have a working Navigation Drawer and having some issues with menuItem.setChecked(true); when using groups and headers within the menu. It\'s not highlighting menu

5条回答
  •  鱼传尺愫
    2021-02-13 12:16

    UPDATE

    If you have upgraded your Android Studio to 1.4, you can create a new project (with Navigation Drawer Activity template). Then, you can update your menu file as the following (pay attention to the two lines inside 2 sub-menus at "Communicate" and "BNK"):

    
    
    
        
            
            
            
            
        
    
        
            
                
                    
                    
                
            
        
    
        
            
                
                    
                    
                
            
        
    
    

    And here is the screenshot

    END OF UPDATE


    As I have commented, please try putting below menus of Settings and General instead of putting below the outside menu. That means you will have 2 groups. Hope this helps!

提交回复
热议问题