开发者

activatedBackgroundIndicator on layout Android honeycomb

I see that the new honeycomb has a gallery sample. and it shows you how to change the color of the selected text view by adding

android:background="?android:attr/activatedBackgroundIndicator"

to your textview

However my row for the list is not only a text view but a collection of views under a linear layout .

To get the same behavior as the honeycomb gallery list selection i tired to set the background of this linear layout but it does not work. The selected row wont change color to blue.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    a开发者_Go百科ndroid:orientation="vertical" android:layout_width="fill_parent"
    android:layout_height="fill_parent" android:background=" android:attr/activatedBackgroundIndicator">
<BUNCH OF OTHER VIEWS/>
</LinearLayout>

thanks in advanced.


You forgot the ? in the front of the android:background attribute value.

Also note that activatedBackgroundIndicator is only available in Android 3.0 and higher.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜