View 动画使用详解
来源:互联网 发布:debian centos 读音 编辑:程序博客网 时间:2024/03/29 15:56
- View 动画xml编写规范
- 通用属性
- translate 平移动画属性详解
- scale 缩放动画属性详解
- rotate 旋转动画属性详解
- alpha 透明度动画属性详解
- animation的使用
View 动画xml编写规范
<?xml version="1.0" encoding="utf-8"?><set xmlns:android="http://schemas.android.com/apk/res/android" android:duration="1000" android:fillAfter="true" android:zAdjustment="normal" android:shareInterpolator="true"> <alpha android:fromAlpha="float" android:toAlpha="float" /> <scale android:fromXScale="float" android:fromYScale="float" android:pivotX="float" android:pivotY="float" android:toXScale="float" android:toYScale="float" /> <translate android:fromXDelta="float" android:fromYDelta="float" android:toXDelta="float" android:toYDelta="float" /> <rotate android:fromDegrees="float" android:pivotX="float" android:pivotY="float" android:toDegrees="float" /></set>
通用属性
android:duration=”1000” 动画持续的时间
android:fillAfter=”true” 动画结束后View是否停留在结束位置,true表示停留在结束位置
translate 平移动画属性详解
android:fromXDelta=”float” 表示x的起始值, 比如“0”
android:fromYDelta=”float” 表示x的结束值,比如“100”
android:toXDelta=”float” 表示y的起始值
android:toYDelta=”float” 表示y的结束值
scale 缩放动画属性详解
android:fromXScale=”float” 水平方向缩放的起始值,如“0.5”
android:fromYScale=”float” 垂直方向缩放的起始值,
android:pivotX=”float” 缩放轴点x的坐标,默认轴点是中心点,若设置为右边界,那么View只会向左边进行缩放
android:pivotY=”float” 缩放轴点y的坐标
android:toXScale=”float”水平方向缩放的结束值,如“1.2”
android:toYScale=”float” 垂直方向缩放的结束值,
rotate 旋转动画属性详解
android:fromDegrees=”float” 旋转开始的角度 比如“0”
android:pivotX=”float” 旋转轴点的x坐标,默认为View中心点.
android:pivotY=”float” 旋转轴点的y坐标
android:toDegrees=”float” 旋转结束的角度 , 比如“180”
alpha 透明度动画属性详解
android:fromAlpha=”float” 透明度的起始值 ,比如“0.1”
android:toAlpha=”float” 透明度的结束值,比如“1”
animation的使用
Button bt1= ( Button ) findViewById(R.id.bt1);Animation animation= AnimationUtils.loadAnimation(context , R.anim.test_anim);bt1.startAnimation(animation);
可以通过setAnimationListener() 方法给动画添加监听。
public static interface AnimationListener { void onAnimationStart(Animation animation); void onAnimationEnd(Animation animation); void onAnimationRepeat(Animation animation); }
- View 动画使用详解
- Android 动画详解之View动画
- android中的tween动画(也叫view动画)原理以及使用详解
- Android动画-View动画的使用场景
- View动画的简单使用
- 【Android 动画】View Animation详解(一)
- 【Android 动画】View Animation详解(一)
- Android View使用详解
- Android View使用详解
- 帧动画使用详解
- 属性动画使用详解
- Android动画使用详解
- Android动画使用详解
- 使用View Animation实现动画加载界面
- 使用View Animation实现动画加载界面
- Android View动画的特殊使用场景
- Android View动画的特殊使用场景
- 使用Scenes和Transitions实现View动画
- QPainter绘制 保存图片
- 收录的一些不错的网址
- iOS学习-删除storyboard中viewController黑屏问题
- C++面试题整理之一
- Kafka原理详解
- View 动画使用详解
- Java IO流-BufferedInputStream和BufferedOutputStream
- 走上未知路
- 使用SharedPreferences来保存用户登录帐号密码
- netty源码学习第三章:ByteBuf
- linux设备驱动归纳总结(三):1字符型设备之设备申请
- ButterKnife使用详解
- 一个前端小白的渐进之路
- 把string[]数组转成string字符串