jiduvah
jiduvah

Reputation: 5168

Sliding Drawer Hiding ListView

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>

Upvotes: 1

Views: 2230

Answers (2)

Passant El.Agroudy
Passant El.Agroudy

Reputation: 1269

set android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" in the sliding drawer

Upvotes: 1

user609239
user609239

Reputation: 3366

With help of FrameLayout, you can display SlidingDrawer above listview. Following link is the article about FrameLayout.

Upvotes: 0

Related Questions