How can I change separator color in NavigationView?

后端 未结 6 1244
失恋的感觉
失恋的感觉 2020-11-27 13:41

I\'m trying to use NavigationView to implement NavigationDrawer. I have added the separator by setting group id in menu. However I can\'t see the separator. I guess it is be

6条回答
  •  旧时难觅i
    2020-11-27 14:21

    Create a style in your styles.xml. Enter your preferred color in the android:listDivider

    
    

    Reference the style as the theme of your navigation view:

       
    

    Lastly, make sure that the groups inside your menu have unique ids. If your groups do not have the id attribute, this won't work!

    
        
    
    
    
        
    
    
    

提交回复
热议问题