【问题标题】:activatedBackgroundIndicator on layout Android honeycomb布局Android蜂窝上的激活背景指示器
【发布时间】:2011-03-03 17:53:45
【问题描述】:

我看到新蜂窝有一个画廊样品。 它向您展示了如何通过添加

来更改所选文本视图的颜色
android:background="?android:attr/activatedBackgroundIndicator"

到你的文本视图

但是,我的列表行不仅是一个文本视图,而且是一个视图下的视图集合 线性布局。

为了获得与蜂窝画廊列表选择相同的行为,我厌倦了设置此线性布局的背景,但它不起作用。所选行不会将颜色更改为蓝色。

<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>

提前致谢。

【问题讨论】:

    标签: android list layout background android-3.0-honeycomb


    【解决方案1】:

    您忘记了android:background 属性值前面的?

    另请注意,activatedBackgroundIndicator 仅适用于 Android 3.0 及更高版本。

    【讨论】:

    • 您好,这对我有用,谢谢,我们可以将背景颜色从蓝色更改为其他颜色吗?
    • @dharan:是的,通过样式资源,虽然我现在没有一个方便的例子。
    • 我可以通过编写一个选择器来做到这一点,例如 schemas.android.com/apk/res/android">
    猜你喜欢
    • 2014-11-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-21
    • 1970-01-01
    • 2017-11-23
    • 2011-11-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多