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. 利用ASP.NET一般处理程序动态生成Web图像(转)

    摘自:http://www.cnblogs.com/zhouhb/archive/2011/02/15/1955262.html 一般处理程序的扩展名为ashx,它实现了IHttpHandler接口, ...

  2. PL/SQL配置oracle客户端,登录远程数据库配置

    本地未安装Oracle数据库,但又想使用PL/SQL连接服务器端的数据库. 1.新建NETWORK文件夹, 在该文件夹下新建ADMIN文件夹, 在该文件夹下新建tnsnames.ora文件(拷贝下面的 ...

  3. tkinter Canvas画图片大坑总结

    一.ImportError: cannot import name '_imagingtk' 问题描述 使用tkinter画pillow生成的图片时,在tkinter中抛出此异常. 解决方案 pip ...

  4. INFO ipc.Client:Retrying connect to server 9000

    hadoop使用bin/start_all.sh命令之后,使用jps发现datanode无法启动 This problem comes when Datanode daemon on the syst ...

  5. GoogleMapsV3-----基础地图(自定义消息提示OverlayView) (转)

    <html> <head> <title> </title> <title></title>    <style type ...

  6. Web 前端性能优化相关内容解析[转]

    Web 前端性能优化相关内容,来源于<Google官方网页载入速度检测工具PageSpeed Insights 使用教程>一文中PageSpeed Insights 的相关说明.大家可以对 ...

  7. 【jQuery】JQuery-ui autocomplete与strtus2结合使用

    汉字搜索效果图: 拼音首字母搜索效果图:  1)数据库表及函数(SQL Server 2008) 先来建立数据库表City,它包含两个字段CityID,CityName. CREATE TABLE C ...

  8. 设置PdfPTable与标题间的距离

    使用itextsharp生成PDF时,需要改变标题与文档中添加的PdfPTable间距离,改变SpacingBefore值不起作用,查了下这方面的知识较少,自己跟踪代码,找到了设置位置是在使用iTex ...

  9. 进程在Linux内核中的角色扮演

    在Linux内核中,内核将进程.线程和内核线程一视同仁,即内核使用唯一的数据结构task_struct来分别表示他们:内核使用相同的调度算法对这三者进行调度:并且内核也使用同一个函数do_fork() ...

  10. 线程模型、pthread 系列函数 和 简单多线程服务器端程序

    一.线程有3种模型,分别是N:1用户线程模型,1:1核心线程模型和N:M混合线程模型,posix thread属于1:1模型. (一).N:1用户线程模型 “线程实现”建立在“进程控制”机制之上,由用 ...