2

I want to implement like this in which sliding menu in drawer layout should be above my button showing red highlighter

I am using drawerlayout with appcomment lib and actionbar with it but not able to do sliding menu over my button

drawer layout sample program downloaded from this link http://developer.android.com/training/implementing-navigation/nav-drawer.html

please how can I add my button in activity with sliding menu will slide over those buttons

Anand Phadke
  • 531
  • 3
  • 28

1 Answers1

1

You can add a Parent Layout manager which will contain drawerlayout and another layout manager with your footer (required button in the bottom)

I have tried a sample:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

<!-- A DrawerLayout is intended to be used as the top-level content view using match_parent for both width and height to consume the full space available. -->

<android.support.v4.widget.DrawerLayout
    android:id="@+id/drawer_layout"
    android:layout_width="required width"
    android:layout_height="required height" >

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

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

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="Footer height" >
</LinearLayout>

I hope this will solve your problem...

Pratik Goyal
  • 294
  • 1
  • 9
  • no it is not working giving me error ... DrawerLayout must be measured with MeasureSpec.EXACTLY. – Anand Phadke Feb 03 '14 at 06:04
  • This can be solved Please find below link for the same. Person named "joecks" has given solution that it can be solved by extending the DrawerLayout, and overriding onMeasure() [StackOverFlow link] (http://stackoverflow.com/questions/17687173/in-robolectric-how-do-i-get-around-drawerlayout-must-be-measured-with-measuresp) – Pratik Goyal Feb 03 '14 at 07:33
  • It is a known bug in Android :( see https://code.google.com/p/android/issues/detail?id=56605 – Pratik Goyal Feb 03 '14 at 07:34