button 相关的问题 请指点 这个在代码里实现 在onclicklistener里面设置background= drawable/select_button 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 那就不能用selector 来控制吗? 好像有难度因为比对下 pressed selected focused pressed window_focused这个5个状态 在没点按钮和点击按钮(鼠标up之后)好像都是一样的(我对selected 和focused 之前的区别也不是很清楚)因为按钮不像文本框 鼠标 up之后会释放焦点吧所以没法区分我也是刚刚接触你再自己看下能不能区分出2种不同的状态只要能分出不同的状态就能用selector实现 <selector xmlns:android="http://schemas.android.com/apk/res/android" > <item android:state_focused = "true" android:state_pressed = "false" android:drawable = "@drawable/selected"> </item> <item android:state_focused = "true" android:state_pressed = "true" android:drawable = "@drawable/pressed"> </item> <item android:state_focused = "false" android:state_pressed = "false" android:drawable = "@drawable/normal"> </item></selector> 还是自己仔细对比下pressed selected focused pressed window_focused的状态吧能区分就能用selector实现不能区分 就代码实现吧 SharedPreferences如何存储集合 时间控件后面显示的“上午” android的"系统设置"用的什么组件 怎样获取到sdcard中的xml资源呢, 系统启动时候 通过receiver 开启一个服务 为什么总是自己停止??? Android 中文api (81)——InputMethod android站点推荐 求一个FM发射的APK Fragment的问题 android用qq第三方登录出错怎么办 怎么能替换RadioButton的选中图片 在线等 onCreate函数的调用
因为比对下 pressed selected focused pressed window_focused
这个5个状态 在没点按钮和点击按钮(鼠标up之后)好像都是一样的
(我对selected 和focused 之前的区别也不是很清楚)
因为按钮不像文本框 鼠标 up之后会释放焦点吧
所以没法区分我也是刚刚接触
你再自己看下能不能区分出2种不同的状态
只要能分出不同的状态就能用selector实现
<item android:state_focused = "true"
android:state_pressed = "false"
android:drawable = "@drawable/selected">
</item>
<item android:state_focused = "true"
android:state_pressed = "true"
android:drawable = "@drawable/pressed">
</item>
<item android:state_focused = "false"
android:state_pressed = "false"
android:drawable = "@drawable/normal">
</item>
</selector>
pressed selected focused pressed window_focused
的状态吧
能区分就能用selector实现
不能区分 就代码实现吧