0

画面の下部からではなく、別のビューの上部から出てくるように、別のビューの上にスライドドロワーを配置するにはどうすればよいですか?

これまでの私のコード:

<?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>

問題は、EditText が消え、スライダーハンドルが EditText の上部ではなく画面の下部にドッキングされることです。

4

2 に答える 2

1

子の順序に基づいてビューを互いに積み重ねるフレームレイアウトを使用します。これにより、引き出しが一番上に表示されます。

于 2011-08-23T11:49:45.780 に答える
0

いくつかの答えを確認してください:

それを行う方法のコード例があります。

于 2012-03-06T16:31:00.743 に答える