Reputation: 365
on my mapview there is a sliding drawer. When the drawer is open, I can still touch and slide the map via it. I changed the background color of the drawer, but only the color is changed, it is still "transparent". Can someone teach how to "fix" it? thank you!
Upvotes: 0
Views: 509
Reputation: 703
By giving background color to its contents
<SlidingDrawer xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer"
android:layout_width="100dp"
android:layout_height="fill_parent"
android:content="@+id/content"
android:handle="@+id/handle"
android:orientation="horizontal" >
<ListView
android:id="@+id/navList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="#000000"
android:gravity="center_vertical" />
</LinearLayout>
</SlidingDrawer>
Upvotes: 1
Reputation: 6461
you need to wrap the content of the sliding drawer with a LinearLayout with a background. here is an xml that will solve your problem :
<SlidingDrawer
android:id="@+id/friends_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:orientation="vertical"
android:content="@+id/content"
android:handle="@+id/handle"
android:focusable="true"
>
<Button
android:id="@+id/handle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pull_me" />
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="@+id/content"
android:background="#fff">
<ListView
android:id="@+id/friends_lv"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
</ListView>
</LinearLayout>
</SlidingDrawer>
Upvotes: 0
Reputation: 2182
try this library for sliding drawer https://github.com/korovyansk/android-fb-like-slideout-navigation
Upvotes: 0