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 回答