Android DrawerLayout - No drawer view found with gravity

前端 未结 9 525
执笔经年
执笔经年 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:15

    The "Android Drawer" needs to be a direct child node of the "DrawerLayout".

    In your example above (re: original question example), you only have a single direct child node under "DrawerLayout" ("LinearLayout"), and no drawer view after it.

    Move your drawer view out of your LinearLayout and place it after it.

提交回复
热议问题