开发者

SlidingDrawer above other views

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


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.


Check some answers:

  • Sliding Drawer From Top
  • How to make an Android SlidingDrawer slide out from the left?
  • http://code.google.com/p/aniqroid - Library to do that

It has code examples of how to do that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜