Android ImageView点击效果

摘要:
--查找类别列表项--˃˂?
ImageView设置点击效果需要注意两点,第一个设置android:clickable="true",第二个 <item android:drawable="@drawable/button_n"/>属性必须放到最后才能生效

<?xml version="1.0" encoding="utf-8"?><!--发现大类列表项--> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ivCategory" android:layout_width="@dimen/x110" android:layout_height="@dimen/x110" android:src="@drawable/bt_icon_pxb" android:clickable="true" android:background="@drawable/bt_discover_category"> </ImageView>


<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/button_d" android:state_checked="true"/> <item android:drawable="@drawable/button_d" android:state_pressed="true"/> <item android:drawable="@drawable/button_n"/> </selector>

免责声明:文章转载自《Android ImageView点击效果》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇ThinkPHP5.0源码学习之框架启动流程注册表比较工具下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Android快速开发_建立MaterialDesign风格框架

建立左侧滑动Drawer 步骤1: 依赖库: compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.android.support:design:23.1.1' 步骤2:  主界面布局使用  android.support.v4.widget.DrawerLayout 1 <...

android简易计算器的实现

最近接触了android开发就试着写了一个计算器的小程序: 在xml文件中的布局代码如下: 1 <?xml version="1.0" encoding="utf-8"?> 2 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3...

百度小程序开发实战--踩坑经历

文章列表rich-text的图片宽度问题效果如下后端返回的数据格式为string,小程序对次采用了rich-text来识别传入的htmlrich-text推荐使用node的数组模式,字符串模式会影响解析速度(因为最终还是会转换为数组类型),但是后端返回的为string格式,是由后台编辑器传入的。这就导致了无法操作css中 rich-text 里边的图片...

《unity项目》打包安卓APK时Build Setting中的三种Build System

Internal(Default):Unity内置,仅需Android SDK支持。不能导出工程,适用于仅适用Unity开发的工程 apk。 Gradle(New):使用Gradle进行构建,需要Android SDK与Gradle支持,可以导出Android Studio工程 apk ; 选这个才能勾选下面的Export Project,适用于Uni...

vue用hbuilderX打包app嵌入h5方式云打包和遇到的问题

vue用hbuilderX打包app嵌入h5方式云打包和遇到的问题 vue用hbuilderX打包app就可以了,不过有兼容性问题,转换rem的用不了,嵌入到app的webview里面变得很小了,另外还有返回键监听的问题需要处理,否则按手机上的返回键不起作用,另外缓存问题,加载页跳转白屏问题也需要优化。======================安卓本地打...

三 APPIUM Android自动化 测试初体验

1.创建一个maven项目 成功新建工程: 编辑pom.xml,在<dependencies></dependencies>下添加appium相关依赖: <dependency> <groupId>org.testng</groupId> <artifactId>...