2015-04-28 11 views

Antwort

6

Sie Schublade Layout

<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"> 
    <!-- The main content view --> 

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

<!-- The navigation drawer --> 
    <ListView android:id="@+id/left_drawer" 
     android:layout_width="240dp" 
     android:layout_height="match_parent" 
     android:layout_gravity="start" 
     android:choiceMode="singleChoice" 
     android:divider="@android:color/transparent" 
     android:dividerHeight="0dp" 
     android:background="#111"/> 


    <ListView android:id="@+id/right_drawer" 
     android:layout_width="240dp" 
     android:layout_height="match_parent" 
     android:layout_gravity="end" 
     android:choiceMode="singleChoice" 
     android:divider="@android:color/transparent" 
     android:dividerHeight="0dp" 
     android:background="#111"/> 
</android.support.v4.widget.DrawerLayout> 

Überprüfen Sie auch die documantation https://developer.android.com/training/implementing-navigation/nav-drawer.html

Stellen Sie sicher, können Sie nicht Symbolleiste Aktionsleiste

+1

wow super danke mann !! 'android: layout_gravity =" end "' ist genial –

2

Ja Sie zwei Listview in der Schublade Layout hinzufügen können, verwenden, ein listview sollte gravitystart haben und andere haben end.

Verwandte Themen