Android 布局图上的激活背景指示灯
我看到新蜂巢有一个画廊样品。 它向您展示了如何通过添加Android 布局图上的激活背景指示灯,android,list,layout,background,android-3.0-honeycomb,Android,List,Layout,Background,Android 3.0 Honeycomb,我看到新蜂巢有一个画廊样品。 它向您展示了如何通过添加 android:background="?android:attr/activatedBackgroundIndicator" 到您的文本视图 但是,列表的“我的行”不仅是一个文本视图,而且是 线性布局 为了获得与蜂巢画廊列表选择相同的行为,我尝试设置此线性布局的背景,但它不起作用。所选行的颜色不会更改为蓝色 <LinearLayout xmlns:android="http://schemas.android.com/apk/re
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:background
属性值的前面
还请注意,
activatedBackgroundIndicator
仅在Android 3.0及更高版本中可用。您忘记了?
在Android:background
属性值前面的
另请注意,activatedBackgroundIndicator
仅在Android 3.0及更高版本中可用。Hiii这对我很有效,谢谢,我们可以将背景颜色从蓝色更改为其他颜色。@dharan:是的,通过样式资源,尽管我现在手头没有这样做的示例。我可以通过编写选择器来实现这一点,例如,这对我很有效谢谢,我们可以将背景颜色从蓝色改为其他颜色吗?@dharan:可以,通过样式资源,尽管我现在手头上没有这样做的例子。例如,我可以通过编写选择器来做到这一点