<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"android:id="@+id/drawerlayout"android:layout_width="match_parent"android:layout_height="match_parent"tools:context=".MainActivity" ><TextViewandroid:id="@+id/textview"android:layout_width="match_parent"android:layout_height="match_parent"android:gravity="center"android:text="content" /><ListViewandroid:id="@+id/listview"android:layout_width="80dp"android:layout_height="match_parent"android:layout_gravity="left"android:background="#FFB5C5" /></android.support.v4.widget.DrawerLayout>实现的效果:
以上所述是小编给大家介绍的使用DrawerLayout组件实现侧滑抽屉的功能,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!