打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
按键状态改变
 
 <ImageView
                         android:id="@+id/img_1"
                         android:adjustViewBounds="true"
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:padding="4dp"
                         android:focusable="true"
                        android:clickable="true"
                         android:tag="1"
                         android:background="@drawable/imgselect"
                         android:src="@drawable/sl1_1" />


imselect(drawable)
<?xml version="1.0" encoding="utf-8"?>
<selector
  xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true" android:state_pressed="false" android:drawable="@drawable/img_on" />
   
    <item android:state_pressed="true" android:drawable="@drawable/img_on" />
    <item android:drawable="@drawable/img_off" />
</selector>
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
自定义类似于listView中Item背景
自定义 RadioButton 选中和未选中时的图片
android 根据button不同状态显示不同(背景)图片
Android 的 selector–背景选择器
定义xml为drawable文件并根据状态改变显示的图片资源
layout
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服