1

Android の winamp と同じ効果を得る方法を知っていますか? 私は同じようなことをしたいです。それは、リストビュー、スライドドロワーポップアップをクリックしたときです。しかし、これまでのところ、同じものではなく、新しいアクティビティでのみスライド ドロワーを表示できます。

オーバーラップ ビューでどのように達成できますか。つまり、引き出しを閉じると、レイアウトが前面に表示され、スライド ハンドルがレイアウト上にあり、引き出しを開くと、メイン レイアウトが覆われます。

それについてのアイデアはありますか?

ありがとう !!

4

2 に答える 2

11

ステップ #1: 作成RelativeLayout

ステップ #2: UI の残りの部分をRelativeLayout

ステップ #3:を後の子として配置SlidingDrawerRelativeLayout、次に UI の残りの部分を配置します (たとえば、レイアウト XML では、それを の最後の子要素として配置しますRelativeLayout) 。

RelativeLayout(および)の子はFrameLayout、Z 軸上 (つまり、画面の外) で互いに重なり合っています。したがって、後の子は前の子とオーバーラップします。ラストを入れることSlidingDrawerで、開いたときに全体が重なります。

于 2010-11-12T16:07:16.380 に答える
0

あなたが私を助けてくれたCommonsWareに感謝します.私は投票するほどの評判はありません. これが私のサンプルレイアウトです...

it.sephiroth.slider.widget.MultiDirectionSlidingDrawerSlidingDrawerとして 使用しました

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="match_parent">
<RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:layout_alignParentLeft="true" android:layout_marginLeft="82dp"
        android:layout_alignTop="@+id/button_open">

    <Button
            android:id="@+id/button_open"
            android:layout_width="100dp"
            android:layout_height="wrap_content"
            android:text="@string/open"
            android:visibility="visible" />
    <EditText
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="New EditText"
            android:id="@+id/editText" android:layout_alignParentLeft="true" android:layout_marginLeft="114dp"
            android:layout_alignParentTop="true" android:layout_marginTop="6dp"/>
</RelativeLayout>

<it.sephiroth.demo.slider.widget.MultiDirectionSlidingDrawer
        xmlns:panel="http://schemas.android.com/apk/res/it.sephiroth.demo.slider"
        android:id="@+id/drawer"

        panel:direction="topToBottom"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        panel:handle="@+id/handle"
        panel:content="@+id/content">
    <include
            android:id="@id/content"
            layout="@layout/pen_content" />
    <ImageView
            android:id="@id/handle"
            android:layout_width="wrap_content"
            android:layout_height="40px"
            android:src="@drawable/sliding_drawer_handle_bottom" />
</it.sephiroth.demo.slider.widget.MultiDirectionSlidingDrawer>
</RelativeLayout>
于 2013-08-15T19:03:19.803 に答える