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点击效果的更多相关文章
- Android ViewGroup点击效果(背景色)
在开发Android应用的界面时,我们必然会用到本文ViewGroup,尤其是FrameLayout,LinearLayout,RelativeLayout等ViewGroup的子类: 在一些情况下, ...
- android 按钮点击效果实现
在其他人的博客里看到其实实现按钮点击效果的方法有很多,这里提到的只是其中一个办法 图片素材(我自己用截图截的,可以自己搞) 放到mipmap目录下(studio是在这个目录下 , eclipse 直接 ...
- Android TextView点击效果
在Android开发中,我们有时候需要单独的点击某一段文本,如图所示: 如上图,我们要求点击新用户注册这个TextView,为了有更好的用户体验,我们肯定要设置该TextView的点击效果.下面介绍如 ...
- Android Button点击效果(按钮背景变色、文字变色)
一. 说明 Android Button的使用过程中,我们会需要为Button添加点击效果,不仅仅按钮的背景色需要变化,而且有时,我们连文字的颜色都希望变化,我们可以使用StateListDrawab ...
- Android ImageView 点击更换头像
首先搭建布局 主界面布局: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ...
- android 按钮点击效果实现 在studio下出现的错误
在照做上一篇随笔的时候 在studio下为了方便我在写完一个 btn_select.xml 文件后直接粘贴了三个文件到drawable下 结果问题来了 总是报这样一个错误: Resource is n ...
- Android设置常见控件点击效果
一. Imageview的点击效果——图片稍微变暗突出点击效果 public class ClickImageView extends AppCompatImageView { public Clic ...
- Android 为点击事件添加震动效果
Android 点击Button 实现震动效果 学习自:网络 Overview 在Android 的点击效果中,遇到震动效果的还是很多的. 接下来就让我们看一下如何实现震动效果. 所需要的权限 如果我 ...
- android View实现变暗效果
android项目中做一个默认图片变暗,有焦点时变亮的效果.相信大家都能各种办法,各种手段很容易的实现这个效果.这里记录下作者实现这个效果的过程及遇到的问题,仅供参考.见下图(注:因为是eclipse ...
随机推荐
- Commons工具包的使用
使用步骤: 1.Java Project下新建Folder文件夹,命名lib 2.lib文件夹下把Commons-io-2.4jar包复制进去 3.右键Commons-io-2.4jar包,点击Bu ...
- MySQL Profiling--常用命令
##=====================================## ## 查看PROFILING是否开启 SELECT @@profiling ## 开始会话级别PROFILING # ...
- apache kafka系列之在zookeeper中存储结构
1.topic注册信息 /brokers/topics/[topic] : 存储某个topic的partitions所有分配信息 Schema: { "version": ...
- Singer 学习九 运行&&开发taps、targets (四 开发target)
singer 的target 需要从stdin 的行数据,同时处理schema.record.state 消息 指南 schema 需要进行关联stream records 数据的校验 一旦Targe ...
- jquery 复选框(选中/取消)获取状态
$("#login-rem").attr("checked","checked") //设置选中 $("#login-rem&qu ...
- S老师 C#编程数据结构篇 学习
直接插入排序 冒泡排序 简单选择排序 线性表: using System; using Sy ...
- NALU数据打RTP包流程详解
最近在看RTP发送H264数据的文章,感觉很乱,没有比较清晰易懂的教程,自己整理了一下各种资料,备忘! --------Part A ---- 先说说H264数据,H264在网络传输的是NALU(N ...
- 5 个关于 API 中日期和时间设计规则
规则 #1 使用ISO-8601格式作为你的日期格式 ISO 8601 解决了很多问题,包括: 自然排序 - 简单和优雅,免去多余的工作即可实现排序 时区偏移 - 代表用户的地点和时区在日益增长的全球 ...
- linux 查看tcp数量
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
- 学习concurrency programming进展
看了一段时间的actor model,goroutine之类的东东,最近在github上写了个简单的框架, 注:未做大量测试,仅供学习用,勿用于生产用途 链接: https://github.com/ ...