use*_*584 0 layout android background list android-3.0-honeycomb
我看到新蜂窝有一个画廊样本.它会向您展示如何通过添加来更改所选文本视图的颜色
android:background="?android:attr/activatedBackgroundIndicator"
Run Code Online (Sandbox Code Playgroud)
到你的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>
Run Code Online (Sandbox Code Playgroud)
提前致谢.
你忘记了属性值?的前面android:background.
另请注意,activatedBackgroundIndicator仅适用于Android 3.0及更高版本.
| 归档时间: |
|
| 查看次数: |
3681 次 |
| 最近记录: |