如何在Android项目中使用selector改变按钮状态-创新互联
如何在Android项目中使用selector改变按钮状态?相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。
Android 使用selector改变按钮状态实例详解
在res/drawable文件夹新增一个文件,此文件设置了图片的触发状态,你可以设置 :
state_pressed,state_checked,state_pressed,state_selected,state_focused,state_enabled 等几个状态:
< selector xmlns:android="http://schemas.android.com/apk/res/android"> < item android:state_pressed="true" android:drawable="@drawable/arrow_pressed" /> < item android:drawable="@drawable/arrow_normal" /> < item android:state_checked="true" android:drawable="@drawable/arrow_pressed" /> < /selector>
本文名称:如何在Android项目中使用selector改变按钮状态-创新互联
网站路径:http://ybzwz.com/article/diisjc.html