Android动画3D立体旋转,属性动画与View动画效果区别
2016-10-23 00:00
736 查看
Android动画3D立体旋转 代码实现:
<pre name="code" class="html"> <ImageView android:layout_centerInParent="true" android:id="@+id/iv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/d" />import android.animation.ObjectAnimator;import android.app.Activity;import android.os.Bundle;import android.widget.ImageView;public class MainActivity extends Activity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);//查找控件ImageView iv=(ImageView) findViewById(R.id.iv);//定义属性动画操作方式rotationY 在Y方向旋转ObjectAnimator oa = ObjectAnimator.ofFloat(iv, "rotationY", new float[] { 90f, 180f, 270f, 360f });// 一个周期时长 oa.setDuration(3000);// 重复次数 oa.setRepeatCount(ObjectAnimator.INFINITE);// 重复方式 oa.setRepeatMode(ObjectAnimator.REVERSE); oa.start();}}
Android中动画是界面必不可少的,但是操作起来确实十分方便,XML 和 代码 两种方式可以随意使用,阿木木代码使用的是属性动画
属性动画和View动画最大的区别就是 属性动画是控件位置发生改变,而view动画则是界面的渲染,控件位置是固定不变的,各位牛人在工作中要注意这点啊!
相关文章推荐
- Android UI:看看Google官方自定义带旋转动画的ImageView-----RotateImageView怎么写(附 图片淡入淡出效果)
- [Android]ScaleViewPager--仿“想去”客户端图片展示效果--中轴旋转ViewPager动画实现
- Android动画精讲一:从setTranslationX谈属性动画和view动画的区别
- Android动画精讲一:从setTranslationX谈属性动画和view动画的区别
- Android自己定义组件系列【11】——实现3D立体旋转效果
- Android UI:看看Google官方自定义带旋转动画的ImageView-----RotateImageView怎么写(附 图片淡入淡出效果)
- 【Android 界面效果32】ImageView中XML属性src和background的区别
- Android——ViewPager实现3D画廊效果(ViewPager的加载动画)
- Android属性动画与自定义View——实现vivo x6更新系统的动画效果
- Android酷炫动画效果之3D星体旋转效果
- Android 3D旋转动画效果
- Android之ViewFlipper:平移、旋转、伸缩、翻页四种动画效果
- Android动画精讲一:从setTranslationX谈属性动画和view动画的区别
- Android 自定义view和属性动画实现充电进度条效果
- Android 3D旋转动画效果
- Android自定义组件系列【11】——实现3D立体旋转效果
- Android 3D旋转动画效果
- Android 3D旋转动画效果
- Android酷炫动画效果之3D星体旋转效果
- Android动画(ViewHelp/3D旋转)