Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make SlidingDrawer transparent

Im currently trying to add the SlidingDrawer in my application.. My activity consists GridView and the SlidingDrawer will be coming from bottom to top.. Now my problem is i need to make the SlidingDrawer as transparent and also move my GridView to top to some extent.. Is this possible to make.. Im new to android.. help me out with this...

If moving the GridView is not an good idea then i want the SlidingDrawer to come above the GridView and make it as a transparent so tat my GridView is visible

Thanks...

like image 600
Hussain Avatar asked Mar 31 '11 08:03

Hussain


1 Answers

To make the SlidingDrawer transparent, set its android:background attribute to @null. See the following example;

<SlidingDrawer android:id="@+id/slider"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:handle="@+id/handle" android:content="@+id/content"
        android:background="@null">
...
...

</SlidingDrawer>

Update:

Above code will make the whole drawer transparent. To make the only the content part, transparent, you can do something like this;

<SlidingDrawer android:id="@+id/slider"
        android:layout_width="fill_parent" android:layout_height="wrap_content"
        android:handle="@+id/handle" android:content="@+id/content"
        android:background="#eeffae" >

        <ImageView android:id="@+id/handle" android:layout_width="55dp"
            android:layout_height="55dp" android:src="@drawable/handle" />

        <LinearLayout android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:id="@+id/content"
            android:orientation="vertical" android:background="@null">

...
...
</LinearLayout>
</SlidingDrawer>
like image 78
Mudassir Avatar answered Oct 10 '22 20:10

Mudassir