AlphaAnimation 淡入淡出动画 

<alpha>A fade-in or fade-out animation. Represents an AlphaAnimation.

attributes:

android:fromAlpha
Float. Starting opacity offset, where 0.0 is transparent and 1.0 is opaque.
动画开始时的透明度
android:toAlpha
Float. Ending opacity offset, where 0.0 is transparent and 1.0 is opaque.
动画结束时的透明度

For more attributes supported by <alpha>, see the Animation class reference (of which, all XML attributes are inherrited by this element).

    <alphaxmlns:android="http://schemas.android.com/apk/res/android"android:duration="1000"android:fromAlpha="1.0"android:toAlpha="0.5" />

要实现淡入淡出设置 android:fromAlpha 和android:toAlpha这俩个属性就可以了  还有一些其他属性可以参见Animation这个父类

android:duration="400" 动画持续的时间 单位毫秒

android:fillAfter="true|false" 如果fillAfter设为true,则动画执行后,控件将停留在动画结束的状态

android:fillBefore="true|false" 如果fillBefore设为true,则动画执行后,控件将回到动画开始的状态

android:startOffset="2000" 设置动画执行之前等待的时间(单位:毫秒)

android:repeatCount="5" 设置动画重复的次数

android:interpolator="@android:anim/linear_interpolator"  设置动画的变化速度

setInterpolator(new AccelerateDecelerateInterpolator()):先加速,后减速

setInterpolator(new AccelerateInterpolator()):加速

setInterpolator(new DecelerateInterpolator()):减速

setInterpolator(new CycleInterpolator()):动画循环播放特定次数,速率改变沿着正弦曲线

setInterpolator(new LinearInterpolator()):匀速

以及其他一些特定的动画效果


translate 实现滑动动画

 <translate  android:duration="2000"  android:fromXDelta="-50%p"  android:fromYDelta="-50%"android:toXDelta="0%p"  android:toYDelta="0%p" />

android:fromXDelta="" X轴偏移量起始时位置

android:toXDelta="" X轴偏移量结束时位置

android:fromYDelta="" Y轴偏移量起始时位置

android:toYDelta="" Y轴偏移量结束时位置

参数可以是 dp,%,%p

其中%是相对于控件本身的相对位置, %p是相对于父容器的位置 

如果是%p 的意思是控件的 左边与上边 距离父容器的偏移量


<scale>标签为缩放节点
android:fromXscale="1.0" 表示开始时X轴缩放比例为 1.0 (原图大小 * 1.0 为原图大小)
android:toXscale="0.0"表示结束时X轴缩放比例为0.0(原图大小 *0.0 为缩小到看不见)
android:fromYscale="1.0" 表示开始时Y轴缩放比例为 1.0 (原图大小 * 1.0 为原图大小)
android:toYscale="0.0"表示结束时Y轴缩放比例为0.0(原图大小 *0.0 为缩小的看不到了)
android:pivotX="50%" X轴缩放的位置为中心点
android:pivotY="50%" Y轴缩放的位置为中心点
android:duration="2000" 动画播放时间 这里是2000毫秒也就是2秒

Android Animation动画效果简介相关推荐

  1. android中设置Animation 动画效果

    在 Android 中, Animation 动画效果的实现可以通过两种方式进行实现,一种是 tweened animation 渐变动画,另一种是 frame by frame animation ...

  2. android编程xml动画,Android中xml设置Animation动画效果详解

    在Android中,Animation动画效果的实现可以通过两种方式进行实现,一种是tweened animation渐变动画,另一种是frame by frame animation画面转换动画. ...

  3. Android Activity动画属性简介

    Android Activity动画属性简介 在Android当中 设置activity的动画 需要复写 android:windowAnimationStyle这个属性 我们自定义一个动画样式来继承 ...

  4. Android m 自定义下拉菜单,Android实现动画效果的自定义下拉菜单功能

    我们在购物APP里面设置收货地址时,都会有让我们选择省份及城市的下拉菜单项.今天我将使用Android原生的 Spinner 控件来实现一个自定义的下拉菜单功能,并配上一个透明渐变动画效果. 要实现的 ...

  5. Android Animation动画详解(二): 组合动画特效

    前言 上一篇博客Android Animation动画详解(一): 补间动画 我已经为大家介绍了Android补间动画的四种形式,相信读过该博客的兄弟们一起都了解了.如果你还不了解,那点链接过去研读一 ...

  6. Android 吸入动画效果详解(仿mac退出效果)

    转载自:http://m.blog.csdn.net/blog/leehong2005/9127095 [转]Android 吸入动画效果详解 1,背景 吸入(Inhale)效果,最初我是在iOS上面 ...

  7. animation动画效果 1002 css3

    animation动画效果 1002 css3 什么是动画 使用步骤 如何定义动画 @keyframes 动画名称{from{属性:值}percentage{属性:值}to{属性:值} } 或者 @k ...

  8. android Loading动画效果

    Android  Loading动画效果 现在项目不是很忙,所以想不能闲着,研究一下大神们是如何实现等待框中的动画显示的,之前看着效果那么帅,那么酷.比猫画虎的写了写代码. 首先在res文件夹下新建一 ...

  9. CSS animation动画效果实现精灵图、雪碧图动画,多动画应用

    CSS animation动画效果实现精灵图.雪碧图动画,多动画应用 素材下载 分析图片动画过程 图片可以分成4*6=24 小图片也就是24帧 方法1 可以把每一行成一个动画,所以可以拆分4个动画 方 ...

最新文章

  1. matlab中help所有函数功能的英文翻译
  2. 给定直角坐标上的两条线,确定这两条线会不会相交
  3. 皮克斯技术指导辞职读博:研究AI设计怪物,从《游戏王》卡牌开始
  4. 一文带你 API 网关从入门到放弃
  5. C/C++中字符串与数字相互转换
  6. 朋友圈发送照片泄露位置?微信:P 完再发!
  7. PDF、图片、合并、转化工具
  8. 网件刷breed_小白爱折腾 篇二:矿渣小娱C1刷breed以安装固件(适用其他路由器)...
  9. seaweedfs问题处理
  10. 图片表格如何转换成excel表格
  11. 捷径|抖音去水印教程
  12. 微信支付商户平台,企业付款,企业向个人付款接口总结
  13. BLE DTM by HCI
  14. 代码进行insmod/rmmod操作
  15. iOS 堆栈获取异常分析
  16. ps5和switch哪个好
  17. 湖北文理学院数学与计算机科学学院,以德为本严要求 以勤为先勇创新——记湖北文理学院数学与计算机科学学院执行院长 吴 钊-湖北文理学院校报电子版《湖北文理学院报》...
  18. 计算机组成认知的笔记1000字,[转载]笔记整理——认知负荷理论
  19. SpringMVC整合websocket实现消息推送及触发
  20. FCPX插件 66种手绘漫画MG动画元素包 Comic Pop 破解版

热门文章

  1. 需求用例分析之三:补充规约
  2. 如何重置云服务器系统
  3. Dart 流中的 listen 和 forEach 有什么区别?
  4. java 素数 五行_【数论】素数的判定与筛法
  5. 鸿蒙上线发布会,华为 HarmonyOS:即日起,全新上线鸿蒙 100 问
  6. 【译】node js event loop part 1.1
  7. tomcat配置虚拟目录,虚拟目录,tomcat目录,tomcat服务器,网站图片虚拟目录
  8. 以经济周期的角度来看世界
  9. learning material at the outer world
  10. 回学校之前在家的清理计划