0

スライド式引き出しの高さを動的または静的に定義したいと思います。以下は私のxmlレイアウトファイルです。任意の提案をいただければ幸いです。

<?xml version="1.0" encoding="utf-8"?>

    <SlidingDrawer android:layout_width="fill_parent"
        android:id="@+id/SlidingDrawer" android:handle="@+id/slideHandleButton"
        android:content="@+id/contentLayout" android:layout_height="wrap_content">
        <ImageView android:layout_width="fill_parent"
            android:layout_height="wrap_content" android:id="@+id/slideHandleButton"
            android:background="@drawable/icon_movie"></ImageView>
        <LinearLayout android:layout_width="fill_parent"
            android:id="@+id/contentLayout" android:gravity="center"
            android:background="#C0C0C0" android:layout_height="wrap_content">
            <Gallery android:id="@+id/gallery" android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
        </LinearLayout>
    </SlidingDrawer>
</FrameLayout>

4

3 に答える 3

2

高さを などの特定の高さに設定する200dpか、または を使用する場合は、この回避策のようなものを使用できますwrap_content

于 2011-03-18T17:06:40.437 に答える
1

XMLのスライディングドロワーでpmarginに設定するだけです

android:layout_marginTop="50dip"
于 2012-02-09T18:50:44.297 に答える
1

SlidingDrawer には topOffset 属性を使用します。

このような...

<SlidingDrawer 
...
android:topOffset="800px"
于 2012-06-09T15:31:56.587 に答える