Android(安卓)点击变样式(变色)。
16lz
2021-01-26
有的项目需求比较高,点击得变色。松开后还原。
其实有很多第三方框架,都很6的。
比如说:这个框架,外国人收集的各种UI动画。
第一种:
点击后变色,松开后颜色返回,。<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/icon_pictures"android:state_pressed="false" /> <item android:drawable="@drawable/icon_pictures2"android:state_pressed="true" />selector>
第二种:选中后变色。再次点击后还原//一般用在RadiosButton中
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/ic_tabbar_store_normal" android:state_checked="false"/> <item android:state_checked="true" android:drawable="@drawable/ic_tabbar_store_click" />selector>
更多相关文章
- android点击返回键退出应用的实现
- Android(安卓)Notification 通知栏点击不能跳转
- Unable to find method 'org.gradle.api.tasks.complie.ComplieO
- Android数据通信开发与应用(四):实战开发
- Android——点击对话框上按钮不关闭对话框
- Android(安卓)无法查看外部依赖jar的源码的问题
- Android(安卓)- TextView 实现部分文本点击事件
- 在CentOS下搭建Android(安卓)开发环境
- 【安卓开发学习】6.ListView点击事…