0

I am working on app where I need navigation drawer .I used the code of google to develop Navigation drawer

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

    <!-- Listview to display slider menu -->

    <ListView
        android:id="@+id/list_slidermenu"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        android:layout_gravity="start"
        android:background="#6495ED"
        android:choiceMode="singleChoice"
        android:divider="@color/list_divider"
        android:dividerHeight="1dp"
        android:listSelector="#fff" />

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

by this i get a navigation drawer ,but i want to put a imageview above list view .I googled it but i dont get of my means

Konrad Krakowiak
  • 12,285
  • 11
  • 58
  • 45
Deep Singh
  • 147
  • 1
  • 3
  • 16

1 Answers1

0

we can add a HeaderView to list by this the userImage will come above the listView like that ViewGroup header = (ViewGroup) inflater.inflate(R.layout.headerview, mDrawerList,false);

    mDrawerList.addHeaderView(header, null, false);
Deep Singh
  • 147
  • 1
  • 3
  • 16