<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="baway.com.drawlayoutdemo.MainActivity"> //主界面布局 <RelativeLayout android:id="@+id/content_frame" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:id="@+id/text" android:text="哈哈哈" android:textSize="18sp" android:padding="8dp" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:text="王亚迪" android:layout_below="@id/text" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </RelativeLayout> //侧滑界面布局在下面 <!--<RelativeLayout--> <!--android:id="@+id/cehua"--> <!--android:layout_width="200dp"--> <!--android:layout_gravity="start"--> <!--android:background="#ffff00"--> <!--android:layout_height="match_parent">--> <!--<Button--> <!--android:id="@+id/button"--> <!--android:text="跳转"--> <!--android:layout_width="wrap_content"--> <!--android:layout_height="wrap_content" />--> <!--</RelativeLayout>--> //侧滑Fragment界面布局在下面 <fragment android:name="baway.com.drawlayoutdemo.Fragment1" android:layout_gravity="start" android:layout_width="200dp" android:layout_height="match_parent"/> </android.support.v4.widget.DrawerLayout>
DrawerLayout侧滑界面
最新推荐文章于 2021-05-31 05:13:43 发布