2012-06-30 88 views
0

何我有兩個框架佈局的列表視圖。 我想要一個覆蓋另一個,它沒有透明背景。 我這樣做覆蓋兩個不透明的listview

<FrameLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 


    <ListView 
     android:id="@+id/autocompleteCompany" 
     android:layout_width="100dip" 
     android:layout_height="wrap_content" 
     android:drawSelectorOnTop="true" 
     android:paddingLeft="30dip" 

     > 

    </ListView> 
    <ListView 
     android:id="@+id/list" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" > 
    </ListView> 
</FrameLayout> 

但不能正常工作。 三江源

回答

0

嘗試使用<RelativeLayout>代替<FrameLayout>

編輯:

爲了擺脫透明度需要設置列表視圖的背景顏色或ListView控件的適配器的項目。這些問題會幫助你做到這一點:

Changing background color of ListView items on Android

listview item background color change

+0

你好感謝你的回答。嗨嘗試相對佈局,但具有相同的結果。 – user1437101

+0

究竟發生了什麼?第二個列表不覆蓋另一個?或者其他一些問題? – KDaker

+0

第二個列表正確地重疊另一個,但第一個的背景是透明的,它可以看到下面的其他列表視圖的項目。 – user1437101