2011-06-15 203 views
1

我想在我的ListActivity中實現滑動繪製。原來的問題是,抽屜在listView後面打開。我已經改變了xml,所以它抽出了抽屜。我現在可以根據需要使用並查看繪圖,但我沒有看到任何列表項。滑動抽屜隱藏ListView

有人可以告訴我我要去哪裏嗎?

<?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> 
+0

在slidingdrawer添加機器人:layout_below =「@機器人:ID /列表」可能工作 – ingsaurabh 2011-06-15 09:28:21

+0

@Saurabh Agnihotri是由ListView控件出現,但隨後滑動平局消失。然後,我刪除了您的建議,並將高度設置爲200,然後顯示兩個滑動抽屜都位於屏幕中間。 – jiduvah 2011-06-15 09:33:56

回答

0

在FrameLayout的幫助下,您可以在列表視圖上方顯示SlidingDrawer。繼link之後 是關於FrameLayout的文章。

1

設置android:layout_alignParentBottom="true" android:layout_centerHorizontal="true"在滑動抽屜