Android : Android Nav Drawer and Toolbar (api 21)

on Monday, November 10, 2014


i have problems with my navigation drawer (i use api 21).


my 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">

<!-- Framelayout to display Fragments -->
<FrameLayout
android:id="@+id/frame_container"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<LinearLayout
android:id="@+id/drawer_linear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical" >

<!-- Toolbar -->
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#0000FF" />


<!-- Listview to display slider menu -->
<ListView
android:id="@+id/list_slidermenu"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@color/list_divider"
android:dividerHeight="1dp"
android:listSelector="@drawable/list_selector"
android:background="@color/list_background"/>

</LinearLayout>

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


Error : View android.widget.linearLayout app:id/drawer_linear is not a sliding drawer. What is wrong in this layout ?


Thanks for help,


0 comments:

Post a Comment