0

I want to make drawer in xml with backcolor, and when I open the drawer, I see the backcolor, but if I didnt open the drawer I dont see the backcolor.

This is what my xml looks like-

<SlidingDrawer

    android:id="@+id/slidingD"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:content="@+id/content"
    android:handle="@+id/handle" 

    android:layout_marginTop="150dp">

    <Button
        android:id="@+id/handle"
        android:layout_width="wrap_content"

        android:layout_height="wrap_content"
        android:text="^" />


    <LinearLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="match_parent" >

        <CheckBox
            android:id="@+id/cbSlidable"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="CheckBox" />
    </LinearLayout>
</SlidingDrawer>
Shumail
  • 3,103
  • 4
  • 28
  • 35
Yagel
  • 1,184
  • 2
  • 18
  • 41

1 Answers1

0

you need to set background color in you "content" layout.

Try this.

<SlidingDrawer

android:id="@+id/slidingD"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:content="@+id/content"
android:handle="@+id/handle" 
android:layout_marginTop="150dp">

<Button
    android:id="@+id/handle"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="^" />


<LinearLayout
    android:id="@+id/content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/black">

    <CheckBox
        android:id="@+id/cbSlidable"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="CheckBox" />
</LinearLayout></SlidingDrawer>

Hope its help

Igor Morais
  • 645
  • 1
  • 8
  • 13