I am currently working on an android project and making use of the SlidingDrawer but I am having a problem with changing the background colour.
By default the SlidingDrawer appears to be transparent so when it is slid up over the content it is hard to read the content of the slidingdrawer due to the main screen being shown underneath.
I wanted to change the background colour to black but for some reason this changes the background colour of the main content so you can't see any of the content and only the content of the sliding drawer when it is pushed up the screen.
Below is the code that I have used to generate the sliding drawer
<SlidingDrawer
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/drawer"
android:handle="@+id/handle"
android:content="@+id/content"
android:background="@color/black">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/handle"
android:src="@drawable/ic_launcher"/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="@+id/content">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I am a sliding drawer - Hello World"/>
</LinearLayout>
</SlidingDrawer>
Thanks for any help you can provide.
Provide background to the LinearLayout
having id of content like this:
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="@+id/content"
android:background="#000">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With