Question

I would like to define the height of sliding drawer height dynamically or statically whatever. Below is my xml layout file. Any suggestion would be appreciate.

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

Was it helpful?

Solution

You can set the height to a specific height such as 200dp, or you can use something like this workaround if you want to use wrap_content.

OTHER TIPS

just set to pmargin in sliding drawer in your xml

android:layout_marginTop="50dip"

Use topOffset attribute for SlidingDrawer.

like this...

<SlidingDrawer 
...
android:topOffset="800px"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top