I want to implement a sliding draw in my ListActivity. The original problem was that the drawer was opening behind the listView. I have changed the xml so it draws the drawer second. I am now able to use and see the draw as I would like but I don't see any list items.
Can anybody tell me where I am going wrong?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ListView
android:id="@android:id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#988767"
android:divider="#00000000"
android:dividerHeight="10dip"
android:layout_margin="10dip"
android:cacheColorHint="#988767"/>
<SlidingDrawer
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/drawer"
android:handle="@+id/handle"
android:content="@+id/content"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="开发者_运维技巧@+id/handle"
android:src="@drawable/arrowup"
/>
<RelativeLayout
android:background="#000000"
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="This is some text"
android:id="@+id/txt"/>
</RelativeLayout>
</SlidingDrawer>
</RelativeLayout>
set android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
in the sliding drawer
With help of FrameLayout, you can display SlidingDrawer above listview. Following link is the article about FrameLayout.
精彩评论