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. [转]MegCup2015初赛题

    原文链接 门票题:数独有多少种对解线上没有1的填法? 这道"门票题"虽说只是"热身",但还是有一定难度的.共有245名选手通过各种方法拿到了门票.下面,我们就为 ...

  2. android通过USB使用真机调试程序

    我的机子很老,开启个android模拟器都要好几分钟,但幸亏有个android的真机,这样直接在andriod手机上调试也是一个不错的选择.下面我就介绍 一下使用android手机来调试android ...

  3. Android 系统 root 破解原理分析

    现在Android系统的root破解基本上成为大家的必备技能!网上也有很多中一键破解的软件,使root破解越来越容易.但是你思考过root破解的 原理吗?root破解的本质是什么呢?难道是利用了Lin ...

  4. python webdriver API学习笔记

    浏览器操作 driver.maximize_window() #浏览器最大化 driver.set_window_size(480,800) #设置浏览器宽,高 driver.back() & ...

  5. CMA概述

    前言 本文是近期学习CMA模块的一个学习笔记,方便日后遗忘的时候,回来查询以便迅速恢复上下文. 学习的基本方法是这样的:一开始,我自己先提出了若干的问题,然后带着这些问题查看网上的资料,代码,最后整理 ...

  6. mysql-5.7中innodb_buffer_pool页面淘汰算法

    一. 什么是innodb_buffer_pool: innodb_buffer_pool是一块内存区域,innodb用它来缓存数据,索引,undo,change buffer ... : 这块区域又被 ...

  7. unity 显示帧率

    Game视图右上角Stats按钮按下即可显示统计信息.

  8. 【Android】7.0 第7章 简单适配器和布局--本章示例主界面

    分类:C#.Android.VS2015: 创建日期:2016-02-09 修改日期:2016-02-13 一.在AssemblyInfo.cs文件中配置应用程序清单 前面的章节我们说过,除了在And ...

  9. gitbook安装与使用

    废话不说,直接主题: gitbook安装 =========== 1. 安装npm  从站点 https://nodejs.org/#download 下载node.js源码(点击绿色的INSTALL ...

  10. angular -- $route API翻译

    $route -$routeProvider服务 -依赖ngRoute模块 $route能够在路径发生改变的时候,渲染不同的视图,调用不同的控制器.它监测了$location.url(),然后根据路径 ...