imagebutton 设置点击和按压效果
实现 点击 时 有按压效果 更换颜色
<ImageButton
android:id="@+id/mediacontroller_Fullscreen_or_not"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="5dp"
android:contentDescription="@string/mediacontroller_Fullscreen_or_not"
android:background="@drawable/mediacontroller_fullscreen_selector"
android:src="@drawable/mediacontroller_fullscreen" />
mediacontroller_fullscreen_selector.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/mediacontroller_bg_pressed" android:state_focused="true"/>
<item android:drawable="@color/mediacontroller_bg_pressed" android:state_pressed="true"/>
<item android:drawable="@color/transparent" android:state_enabled="false"/>
<item android:drawable="@color/transparent"/>
</selector>
colors.xml
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<color name="transparent">#00000000</color>
<color name="mediacontroller_bg_pressed">#ff53c1bd</color>
<color name="mediacontroller_bg">#99000000</color>
</resources>
imagebutton 设置点击和按压效果的更多相关文章
- zoom动画,实现图片点击预览效果
参考:https://developer.android.google.cn/training/animation/zoom.html 1.创建Views 下面的布局包括了你想要zoom的大版本和小版 ...
- ImageButton按压效果失效
LinearLayout中ImageButton的按压效果不起作用,如图 布局如下: <LinearLayout android:id="@id/ll_add_reply_face&q ...
- ImageView设置点击效果没有用?ImageView src的图片大小改变不了?
ImageView设置点击效果没有用? 解决 1.ImageView xml里面必须clickable 和longClickable为true <ImageView android:layout ...
- Android Studio 之 Button(圆角,描边,按压效果)
•普通Button <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns: ...
- 给EditText的drawableRight属性的图片设置点击事件 分类: 学习笔记 android 2015-07-06 13:20 134人阅读 评论(0) 收藏
这个方法是通用的,不仅仅适用于EditText,也适用于TextView.AutoCompleteTextView等控件. Google官方API并没有给出一个直接的方法用来设置右边图片的点击事件,所 ...
- Button的几种常用的xml背景,扁平化,下划线,边框包裹,以及按压效果
Button的几种常用的xml背景,扁平化,下划线,边框包裹,以及按压效果 分享下我项目中用到的几种Button的效果,说实话,还真挺好看的 一.标准圆角 效果是这样的 他的实现很简单,我们只需要两个 ...
- 给EditText的drawableRight属性的图片设置点击事件
这个方法是通用的,不仅仅适用于EditText,也适用于TextView.AutoCompleteTextView等控件. Google官方API并没有给出一个直接的方法用来设置右边图片的点击事件,所 ...
- Android特效专辑(十)——点击水波纹效果实现,逻辑清晰实现简单
Android特效专辑(十)--点击水波纹效果实现,逻辑清晰实现简单 这次做的东西呢,和上篇有点类似,就是用比较简单的逻辑思路去实现一些比较好玩的特效,最近也是比较忙,所以博客更新的速度还得看时间去推 ...
- 小程序map地图点击makert放大效果和点击放大地图
WXML文件和JS文件代码在下方 <view class='map'> <map id="map" longitude="{{location.lng} ...
随机推荐
- C# Task详解
1.Task的优势 ThreadPool相比Thread来说具备了很多优势,但是ThreadPool却又存在一些使用上的不方便.比如: ◆ ThreadPool不支持线程的取消.完成.失败通知等交互性 ...
- JAVA基础数组
数组: 数组是一种容器 存储同一类型的一组数据(必须是 类型相同的一组数据) 定义数组的公式:(有两种) 1.静态定义 1)数据类型[ ] 数组名 = {元素1,元素2,元素3,元素4,元素 ...
- JavaScript--小白入门篇2
一.布尔值和关系运算符.逻辑运算符 1.1 布尔值 我们上篇文章说了,学习了两种变量的类型数值型.字符串型. 实际上,还有很多变量的类型.我们今天再学习一种,叫做“布尔类型”. 数值型里面的值 ...
- [USACO06JAN] 冗余路径 Redundant Paths
题目描述 In order to get from one of the F (1 <= F <= 5,000) grazing fields (which are numbered 1. ...
- http://localhost/main/company/jurtion---外卖权限添加
http://localhost/main/company/jurtion---外卖权限添加
- Spark在Executor上的内存分配
spark.serializer (default org.apache.spark.serializer.JavaSerializer ) 建议设置为 org.apache.spark.ser ...
- PM2 & chmod +x
PM2 https://www.npmjs.com/package/pm2 https://github.com/Unitech/pm2 docs https://pm2.io/doc/en/runt ...
- Navicat使用技巧
1.有时按快捷键Ctrl+F搜某条数据的时候搜不到,但是能用sql查出来,这是怎么回事? Ctrl+F只能搜本页数据,不在本页的数据搜不到,navicat每页只显示1000条数据.在数据多的时候nav ...
- noip模拟赛 whzzt-Warmth
分析:这道题难度和天天爱跑步差不了多少啊......裸的暴力只有10分,最好大的还是那个5%的数据,不过这也才15分,比天天爱跑步的暴力分不知道少到哪里去了. 正解是dp,毕竟要求方案数嘛,但是这个d ...
- RSYNC最简实施
只是内网同步,故而可以省略很多安全方面的东东.不需要通过ssh,而是通过rsync协议.不需要用户名认证,保证只读. rsync用standalone的daemon方式,而不用service方式操作. ...