2015-08-31 25 views

回答

0
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:id="@+id/drawer_layout" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 


    <FrameLayout 
     android:id="@+id/container" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent"> 

     //your stuff goes here 


    </FrameLayout> 


    <FrameLayout 
     android:id="@+id/navigation_drawer" 
     android:layout_width="@dimen/navigation_drawer_width" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" /> 


</android.support.v4.widget.DrawerLayout> 

ID爲的FrameLayout navigation_drawer將是你的抽屜裏,你可以加載這裏面任何複雜的視圖中使用Fragment