Android DrawerLayout - No drawer view found with gravity

前端 未结 9 544
执笔经年
执笔经年 2020-11-27 06:23

When I click on my drawer toggle I get the following exception:

java.lang.IllegalArgumentException: No drawer view found with gravity LEFT

9条回答
  •  借酒劲吻你
    2020-11-27 07:03

    From documentation

    To use a DrawerLayout, position your primary content view as the first child with a width and height of match_parent. Add drawers as child views after the main content view and set the layout_gravity appropriately. Drawers commonly use match_parent for height with a fixed width.

    
    
        
    
        
    
        
    
        
    
        
    
    
    

提交回复
热议问题