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).

    <alpha
xmlns: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由四种类型组成 XML中 alpha 渐变透明度动画效果 scale 渐变尺寸伸缩动画效果 translate 画面转换位置移动动画效果 rotate 画面转移旋转动 ...

  2. Android中xml设置Animation动画效果详解

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

  3. android中设置Animation 动画效果

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

  4. Android Activity动画属性简介

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

  5. Android Animation 动画属性

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

  6. android Animation动画的xml使用

    在Android应用程序,使用动画效果,能带给用户更好的感觉,做动画能够通过XML或Android代码来实现. Animation动画效果的实现能够通过两种方式进行实现,一种是tweened anim ...

  7. [Android]Animation 动画介绍和实现

    Animation动画效果来实现菜单的显示和隐藏,本文就来介绍下吧. 1.Animation 动画类型 Android的animation由四种类型组成: XML中 alph 渐变透明度动画效果 sc ...

  8. Android Animation动画实战(二):从屏幕底部弹出PopupWindow

    在这篇文章之前,我已经陆陆续续写了几篇博客,介绍了Android Animation是如何使用的,有还不明白的,可以点击查看: 1. Android Animation动画详解(一): 补间动画 2. ...

  9. Android Animation动画实战(一): 从布局动画引入ListView滑动时,每一Item项的显示动画

    前言: 之前,我已经写了两篇博文,给大家介绍了Android的基础动画是如何实现的,如果还不清楚的,可以点击查看:Android Animation动画详解(一): 补间动画 及 Android An ...

随机推荐

  1. 使用DotNetBarcode制作基本常用条码

    核心代码: /// <summary> /// 打印一维码 /// </summary> /// <param name="codeText"> ...

  2. HDUOJ-------Naive and Silly Muggles

    Naive and Silly Muggles Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/ ...

  3. Servlet乱码问题

    数据像水流一样从一个地方流向另一个地方. 文本流是特殊的二进制流. 既然提到乱码问题,那就必然是用错误的编码去解释二进制流. 在传输过程中必然都是以二进制流传输的. 所以,我们需要考虑的是: 有几个数 ...

  4. JavaScript 设计模式之简介

    一.设计模式概念解读 设计模式(Design pattern)是一套被反复使用.多数人知晓的.经过分类编目的.无数实战代码设计经验的总结.使用设计模式是为了让系统代码可重用.可扩展.可解耦.更容易被人 ...

  5. 在TFS 2013上,使用tf workspace命令删除其他用户的工作区

    8月25日补充:如果想批量删除工作区,你可以使用第三方工具MSBuild Sidekick http://www.attrice.info/downloads;或者自己编写一个bat脚本,但是缺陷是需 ...

  6. Concurrency Managed Workqueue(三)创建workqueue代码分析

    一.前言 本文主要以__alloc_workqueue_key函数为主线,描述CMWQ中的创建一个workqueue实例的代码过程. 二.WQ_POWER_EFFICIENT的处理 __alloc_w ...

  7. 免费申请 Github 私有仓库--学生和教育人士的福利

    免费申请 Github 私有仓库 -学生和教育人士的福利 Github 是全球知名的软件项目托管网站.在 Github 创建私有仓库是需要收费的,收费方案有多种,费用最小的方案是每月 7 美元的“微型 ...

  8. Spring Cloud Netflix概览和架构设计

    Spring Cloud简介 Spring Cloud是基于Spring Boot的一整套实现微服务的框架.他提供了微服务开发所需的配置管理.服务发现.断路器.智能路由.微代理.控制总线.全局锁.决策 ...

  9. Windows XP忘记密码的几种解决方法

    1. 问题 朋友一Windows XP系统的密码忘记了,让给解决一下.网上搜索了几种解决方案,列在下面,记一下. 2. 解决 2.1 使用“Administrator”帐户 前提:当前用户名不是“Ad ...

  10. [hihoCoder] #1158 : 质数相关

    时间限制:2000ms 单点时限:1000ms 内存限制:256MB 描述 两个数a和 b (a<b)被称为质数相关,是指a × p = b,这里p是一个质数.一个集合S被称为质数相关,是指S中 ...