selector drawable没有效果解决

android给textView 设置selector没有效果
【中秋佳节】码云陪你一起赏花赏月拿豪礼>>> »

我给textView 设置selector没有效果下面是layout,Relative和下面的三个TextView的background就是设置的selector,我在代码中实现了他们的监听的。
?
1
2
3
4
5
6


<item android:drawable="@color/colorWhite"/>

这一句放在最后。

— 共有 1 条评论 —
pokerWu感谢,成功了!请问这是为什么? (1年前)
评论(1)| 引用此答案| 举报 (2015-07-15 13:59)
0
notreaminotreami 1年前
我觉得选中应该是这个 android:state_selected

— 共有 1 条评论 —
pokerWu我只需要pressed的效果,就只需要点击效果。 (1年前)
评论(1)| 引用此答案| 举报 (2015-07-15 13:31)
0
CalssNotFoundCalssN… 1年前
android:clickable=”true”
— 共有 1 条评论 —
pokerWu设置了的 (1年前)
评论(1)| 引用此答案| 举报 (2015-07-15 13:32)
0
monroemonroe 1年前
引用来自“monroe”的评论


<item android:drawable="@color/colorWhite"/>

这一句放在最后。

http://developer.android.com/guide/topics/resources/drawable-resource.html#StateList

During each state change, the state list is traversed top to bottom and the first item that matches the current state is used—the selection is not based on the “best match,” but simply the first item that meets the minimum criteria of the state.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值