ScaleAnimation 缩放动画效果  是安卓中的动画效果之一
相关构造初始化方法 ScaleAnimation scale =new 
ScaleAnimation(Context context, AttributeSet attrs)  从XML文件加载动画,基本用不到
ScaleAnimation(float fromX, float toX, float fromY, float toY)
ScaleAnimation(float fromX, float toX, float fromY, float toY, float pivotX, float pivotY)
ScaleAnimation(float fromX, float toX, float fromY, float toY, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)
ScaleAnimation(float fromX, float toX, float fromY, float toY,int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)</span>
float fromX 动画起始时 X坐标上的伸缩尺寸
float toX 动画结束时 X坐标上的伸缩尺寸
float fromY 动画起始时Y坐标上的伸缩尺寸
float toY 动画结束时Y坐标上的伸缩尺寸
int pivotXType 动画在X轴相对于物件位置类型
float pivotXValue 动画相对于物件的X坐标的开始位置
int pivotYType 动画在Y轴相对于物件位置类型
float pivotYValue 动画相对于物件的Y坐标的开始位置 

相关的设置

ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 1.0f, 1.0f,Animation.RELATIVE_TO_SELF, 0.5f,Animation.RELATIVE_TO_SELF, 1.0f);//逐渐加速进入的动画 先慢后快
//        scaleAnimation.setInterpolator(AnimationUtils.loadInterpolator(this,
//                android.R.anim.accelerate_interpolator));//        加速进入.与第一个的区别为当repeatMode为reverse时,仍为加速返回原点
//        scaleAnimation.setInterpolator(AnimationUtils.loadInterpolator(this,
//                android.R.anim.accelerate_decelerate_interpolator));//先向后退一点再加速前进
//        scaleAnimation.setInterpolator(AnimationUtils.loadInterpolator(this,
//                android.R.anim.anticipate_interpolator));//        //减速前进  冲过终点后再后退
//        scaleAnimation.setInterpolator(AnimationUtils.loadInterpolator(this,
//                android.R.anim.overshoot_interpolator));先往后退一点再加速前进   再减速超过一点再后退
//        scaleAnimation.setInterpolator(AnimationUtils.loadInterpolator(this,
//                android.R.anim.anticipate_overshoot_interpolator));//停止下来回振几次scaleAnimation.setInterpolator(AnimationUtils.loadInterpolator(this,android.R.anim.bounce_interpolator));//逐渐减速进入的动画  先快后慢
//        scaleAnimation.setInterpolator(AnimationUtils.loadInterpolator(this,
//                android.R.anim.decelerate_interpolator));//设置动画启动的延时时间scaleAnimation.setStartOffset(300);//设置动画执行的时间scaleAnimation.setDuration(2000);//设置重复的次数scaleAnimation.setRepeatCount(Integer.MAX_VALUE);
//        //设置执行的模式 RESTART为结束后重新开始,
//        scaleAnimation.setRepeatMode(Animation.RESTART);
//        //设置执行的模式为按原来的轨迹逆向返回scaleAnimation.setRepeatMode(Animation.REVERSE);//        scaleAnimation.setRepeatMode(Animation.START_ON_FIRST_FRAME);
//        scaleAnimation.setRepeatMode(Animation.ZORDER_BOTTOM);
//        scaleAnimation.setRepeatMode(Animation.ZORDER_NORMAL);
//        scaleAnimation.setRepeatMode(Animation.ZORDER_TOP);//绝对位置
//        scaleAnimation.setRepeatMode(Animation.ABSOLUTE);//无限循环
//        scaleAnimation.setRepeatMode(Animation.INFINITE);//相对于父控件
//        scaleAnimation.setRepeatMode(Animation.RELATIVE_TO_PARENT);//相对于本身
//        scaleAnimation.setRepeatMode(Animation.RELATIVE_TO_SELF);AnimationSet animationSet = new AnimationSet(true);animationSet.addAnimation(alphaAnimation1);animationSet.addAnimation(scaleAnimation);mTvTitleBackground.startAnimation(scaleAnimation);
</pre><pre name="code" class="html">
XML中的定义方式  
<pre name="code" class="html"><?xml version="1.0" encoding="utf-8"?>
<scale xmlns:android="http://schemas.android.com/apk/res/android"android:fromXScale="1.0"android:toXScale="0.0"android:fromYScale="1.0"android:toYScale="0.0"android:pivotX="50%"android:pivotY="50%"android:fillAfter="true"android:duration="400">
</scale>

Android Animation --ScaleAnimation相关推荐

  1. android 动画延时执行,Android Animation --ScaleAnimation

    ScaleAnimation 缩放动画效果  是安卓中的动画效果之一 相关构造初始化方法 ScaleAnimation scale =new ScaleAnimation(Context contex ...

  2. android - Animation详解

    Drawable 最强大的功能是:显示Animation.AndroidSDK介绍了2种Animation: Tween Animation(渐变动画):通过对场景里的对象不断做图像变换(平移.缩放. ...

  3. Android Animation动画(很详细)

    Animations 一.Animations介绍 Animations是一个实现android UI界面动画效果的API,Animations提供了一系列的动画效果,可以进行旋转.缩放.淡入淡出等, ...

  4. android Animation 动画。淡出动画

    淡出动画 protected void startHotelNearByIconAnim() {AlphaAnimation alphaAnimation = new AlphaAnimation(1 ...

  5. android animation学习

    本文出自http://wangstar.javaeye.com/blog/409115,感觉基础知识归纳得不错,就COPY下来方便查找. 动画效果编程基础--Android Animation     ...

  6. Android动画(Android Animation)笔记

    demo源码地址:https://github.com/totond/LearnAnimation Android里动画时非常常见的,几乎每个炫酷的自定义控件都涉及动画.Android里面的动画分为两 ...

  7. Android Animation (动画设计)

    Android Animation(动画设计) 本文主要介绍逐帧动画,补间动画,属性动画 使用简单的图片 1.Bitmap和BitmapFactory 把一个Bitmap包装成BitmapDrawab ...

  8. Android Animation和Animator

    Android Animation和Animator 一.一个很蠢的Bug 二.Animation 2.1 TranslateAnimation平移动画 2.2 RotateAnimation旋转动画 ...

  9. Android Animation (安卓动画)概念简介

    Android Animation Android 四种动画分别为逐帧动画和补间动画.属性动画.过渡动画: Frame Animation (逐帧动画) 实现方式:xml 和 Java代码 图片跳转的 ...

最新文章

  1. 单片微机原理P4:80C51串口与串行总线拓展
  2. SpringMVC深度探险(二) —— SpringMVC概览
  3. ubuntu12.10下arm-linux-gcc交叉编译环境的搭建
  4. Android实例RSS客户端开发(2)--解析XML文件
  5. 从像素坐标到相机坐标_鱼眼相机模型EUCM(一)
  6. box-shadow
  7. C++中读取文件乱码问题
  8. 登录Ubuntu提示有软件包可以更新
  9. drupal ajax json异步调用
  10. 如何利用vmware workstation安装linux
  11. 程序员代码面试指南:IT名企算法与数据结构题目最优解(第2版) 左程云
  12. sql插入不重复的数据
  13. 使用laypage和pageHelper分页
  14. centos7桌面没有计算机图标,Centos7,桌面图标消失且右键失效
  15. VR/AR时代最大的瓶颈是什么?
  16. RuntimeException: Method ___ not mocked
  17. 做实景三维项目后的一些感想
  18. 原来是这么做的,在抖音解说电影,6个月赚了40w?
  19. Postman使用小技巧 - 用Postman生成Request代码
  20. ZOJ 3736 模拟魔方

热门文章

  1. python基础:抓取博客网页上的图片并且保存的例子
  2. 画手cv什么意思_lt;3招gt;助你搞定工科出国留学申请简历(CV)!
  3. bit java实验2_2018-2019-2 20175120 实验五《Java网络编程》实验报告
  4. OpenCV的resize方法与双线性插值
  5. 可解释性与deep learning的发展
  6. Tensorflow新手通过PlayGround可视化初识神经网络
  7. 从零开始编写深度学习库(四)Eigen::Tensor学习使用及代码重构
  8. C++标准库vector及迭代器
  9. 劳务费计算用matlab实现
  10. boa服务器 系统设置,Ubuntu中配置boa服务器