I'd like to create a full width navigation drawer. Setting layout_width
to match_parent
on @+id/left_drawer
yields in width of about 80% of screen space. This seems to be the standard behavior. Do I have to override onMeasure()
of DrawerLayout
?
My current code:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
android:id="@+id/mainFragmentContainer">
</FrameLayout>
<include
android:id="@+id/left_drawer"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="start"
layout="@layout/drawer"/>
</android.support.v4.widget.DrawerLayout>
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…