DrawerLayout側滑界面

<?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>
發佈了77 篇原創文章 · 獲贊 2 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章