点赞动画
来源:互联网 发布:淘宝精品推荐在哪里 编辑:程序博客网 时间:2024/06/05 05:38
先上效果图
这个动画的实现就是通过缩放动画实现的
- 1,写一个动画的XML文件,myscale.xml
<?xml version="1.0" encoding= "UTF-8"?><set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false" > <!--android:interpolator:动画的插入器,用于描述动画的运行情况,常用的有accelerate_decelerate_interpolator(先加速后减速),accelerate_interpolator(加速器)等android:fromXScale:X轴开始动画缩放的比例android:toXScale:X轴结束时动画缩放的比例android:fromYScale:Y轴开始动画缩放的比例android:toYScale:Y轴结束动画缩放的比例,以上四个属性定义了将图片从0.3的比例大小放大到1.0的比例大小(即原大小)android:pivotX:固定点X轴坐标android:pivotY:固定点Y轴坐标android:duration:动画持续时间,5000表示5000毫秒,即5秒android:repeatCount:动画重复次数,-1表示无限循环重复Android:repeatMode:重复模式,reverse表示反向进行,在这里先放大,后缩小--> <scale android:interpolator="@android:anim/accelerate_decelerate_interpolator" android:fromXScale="1.0" android:toXScale="1.3" android:fromYScale="1.0" android:toYScale="1.3" android:pivotX="50%" android:pivotY="50%" android:duration="700" android:repeatCount="1" android:repeatMode="reverse" /></set>
- 2,调用很简单
Animation mAnimation = AnimationUtils.loadAnimation(mContext,R.anim.myscale);iv_like.setAnimation(mAnimation );mAnimation.start();
很简单吧!
阅读全文
1 0
- 点赞动画
- 自定义点赞动画
- 点赞动画+1
- 点赞收藏动画
- Android点赞动画
- 点赞动画
- iOS----点赞动画
- 点赞动画,鼠标点击动画
- 点赞, 飘赞动画
- 点赞Layer动画代码
- android实现点赞动画
- 点赞动画的效果
- 需求 - 18 - “点赞动画”
- 仿直播点赞动画
- 直播点赞动画实现
- 属性动画_点赞
- Android动画效果(二) 仿QQ点赞动画
- 仿映客点赞效果 点赞上升动画&&全屏点赞
- linux下 多线程的实现 C++
- 安卓沉浸式
- C和C++之间库的互相调用
- 资料收藏
- 在ubuntu下利用minicom实现串口通信
- 点赞动画
- 右侧悬浮菜单定位瞄点
- java中使用Jedis操作Redis数据库
- Codeforces 812C-Sagheer and Nubian Market
- 设计模式 模板方法模式 Template Method
- 学习Vue之路(一)
- easyui-datagrid关于展示的字段需要进行数据类型转换的问题(自己记录备忘)
- git日常命令
- Struts2,action中用spring注入,启动服务时注入成功,action运行时对象又变成null了