ListView中item点击的时候颜色变化
来源:互联网 发布:九次方大数据怎么样 编辑:程序博客网 时间:2024/04/28 13:36
在drawable中定义一个图像xml
xxx_bg.xml
<?xml version="1.0" encoding="utf-8" ?><selector xmlns:android="http://schemas.android.com/apk/res/android"><!-- 没有焦点时的背景颜色 此项相当与直接在布局中设置的background--><item android:state_window_focused="false" android:drawable="@color/white" /><!--非触摸模式下获得焦点并单击时的背景颜色 <item android:state_focused="true"android:state_pressed="true" android:drawable="@color/pressed" />--><!--触摸模式下单击时的背景颜色 item被点击的时候颜色的改变,松开后颜色还原--><item android:state_focused="false" android:state_pressed="true"android:drawable="@color/focused" /><!--选中时的背景颜色 <item android:state_selected="true"android:drawable="@color/selected" />--><!--获得焦点时的背景 颜色 <item android:state_focused="true"android:drawable="@color/focused" />--></selector>然后在item中你要设置的地方让android:background="@drawable/xxx_bg" 就可以实现了
- ListView中item点击的时候颜色变化
- 去掉listview的item点击时候的背景颜色
- 如何让listview点击item的时候不变颜色
- Android中listview的item点击时候去掉背景颜色或者设置成透明的
- android listview内的TextView会在点击item的时候灰变背景颜色
- 去掉或设置 listview的item点击时候的背景颜色
- ListView 点击Item的时候,改变文字颜色和背景色
- ListView 点击Item的时候,改变文字颜色和背景色
- ListView 点击Item的时候,改变文字颜色和背景色
- android listView 点击Item的时候,改变文字颜色和背景色
- Android ListView 点击Item的时候,改变文字颜色和背景色
- 监听listview中item有控件点击事件的变化,更新listview
- listview item中点击按钮变化 滑动错乱
- ListView item被选中时颜色的变化
- 如何在ListView中点击item控制item中的控件变化(ListView篇)
- ListView中TextView和item背景点击改变颜色
- ListView的Item包含checkBox的时候的点击事件
- 设置ListView的item在press状态时候的颜色
- 关于 The reference to entity XX must end with the ‘;’ delimiter
- 常见的数字证书格式
- Windows搭建并使用SVN全过程
- Win7下无法显示CHM文档内容的解决办法
- 线程状态的转换
- ListView中item点击的时候颜色变化
- IdFTP
- 动态域名解析间谍 Peanuthull DDNS
- 2011.09.05
- HDOJ A strange lift
- 使用jQuery UI Datepicker 小结
- d3d错误
- 【无定根朱刘算法】hdu 3072
- Flex StyleManager.getStyleDeclaration 解决办法