0

how do i place a slidingdrawer above another view so i doesnt come out from the bottom of the screen, but from the top of another view ?

my code so far:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:orientation="vertical"
          android:background="@drawable/splash">
  <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:layout_gravity="bottom"
                  android:background="#000000">
     <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                   android:layout_width="fill_parent"
                   android:layout_height="fill_parent"
                   android:orientation="vertical"
                   android:background="@drawable/splash">
        <Button android:id="@id/content"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:text="I'm in here!"/>
     </LinearLayout>
     <SlidingDrawer android:id="@+id/drawer"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:handle="@+id/handle"
                    android:content="@+id/content">
        <ImageView android:id="@id/handle"
                   android:layout_width="wrap_content"
                   android:layout_height="wrap_content"
                   android:src="@drawable/categories_bar_flipped"/>
        <Button android:id="@id/content"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:text="I'm in here!"/>
     </SlidingDrawer>
  </RelativeLayout>
  <EditText xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"/>
</LinearLayout>

problem is that the EditText disappeares and the sliderhandle is dokked at bottom of screen instead of at top of the EditText

Esben Andersen
  • 802
  • 2
  • 9
  • 18
  • I believe the sliding drawer has to be docked against an edge of the screen. If you need some different behavior, you may need to extend SlidingDrawer and create a custom view. – Sashi Kolli Aug 22 '11 at 19:45

2 Answers2

1

Use a framelayout which will stack views on top of each other based on the order of the childs. That should make the drawer appear on top.

blessanm86
  • 31,439
  • 14
  • 68
  • 79
0

Check some answers:

It has code examples of how to do that.

Community
  • 1
  • 1
neteinstein
  • 17,529
  • 11
  • 93
  • 123