0
我看到新的蜂窩有一個畫廊樣本。 並說明了如何通過添加佈局Android honeycomb上的activatedBackgroundIndicator
android:background="?android:attr/activatedBackgroundIndicator"
您的TextView更改所選文本視圖的色彩
但是我的列表行不僅是文本視圖,但視圖下的集合 線性佈局。
爲了獲得與蜂窩畫廊列表選擇相同的行爲,我厭倦了設置此線性佈局的背景,但它不起作用。所選的行不會將顏色更改爲藍色。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background=" android:attr/activatedBackgroundIndicator">
<BUNCH OF OTHER VIEWS/>
</LinearLayout>
感謝先進。
嗨這工作給我謝謝,我們可以更改背景顏色從藍色到其他顏色。 – dharan 2012-06-08 14:18:00
@dharan:是的,通過一個風格資源,儘管我現在沒有一個這樣做的例子。 – CommonsWare 2012-06-08 14:35:47
我可以通過編寫選擇器來實現這個功能,例如<?xml version =「1.0」encoding =「utf-8」?> –
dharan
2012-06-15 05:39:55