Why is my Android navigation drawer opening too wide?

后端 未结 1 858
梦谈多话
梦谈多话 2020-12-02 03:02

I had a rather basic navigation drawer working pretty well -- a simple ListView. But I need a title above the selectable items, so (see below) modified the XML for the draw

相关标签:
1条回答
  • 2020-12-02 03:49

    The layout_gravity attribute determines which child View acts as the drawer in a DrawerLayout. Currently, neither of the direct children of your DrawerLayout has that attribute set, so both are just filling it, with the LinearLayout on top, covering the content RelativeLayout.

    Move android:layout_gravity="left" from the ListView to the LinearLayout.

    0 讨论(0)
提交回复
热议问题