2013-11-15 81 views
0

我想在ListView拆分項目,以獲得相同的結果三星的聯繫電話列表中的ListView:拆分的ListView項目爲兩列

Samsung contact list

當在左/右列點擊,只有該列的背景發生變化。我試圖插入一個圖像按鈕到一列列表視圖,但是當不直接點擊按鈕時,整行的背景會發生變化(包括ImageButton的背景)。

如何獲得與三星相同的ListView?

回答

1

我用這個代碼,併爲我好

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="horizontal" 
    android:weightSum="3" > 

    <Button 
     android:id="@+id/text" 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="2" 
     android:drawableRight="@drawable/ic_launcher" 
     android:gravity="center_vertical" 
     android:text="trtrtrt" /> 

    <ImageButton 
     android:layout_width="0dp" 
     android:layout_height="match_parent" 
     android:layout_weight="1" 
     android:src="@drawable/ic_launcher" /> 

</LinearLayout> 
0

使用android:listSelector="@null"列表中的XML工作,如果它不工作,那麼我想看看到你的代碼,如果你可以將它張貼。