Android 动画之RotateAnimation应用详解
来源:互联网 发布:淘宝哪里实名认证了 编辑:程序博客网 时间:2024/05/16 06:23
RotateAnimation (float fromDegrees, float toDegrees, int pivotXType, float pivotXValue, int pivotYType, float pivotYValue)
参数说明:
float fromDegrees:旋转的开始角度。
float toDegrees:旋转的结束角度。
int pivotXType:X轴的伸缩模式,可以取值为ABSOLUTE、RELATIVE_TO_SELF、RELATIVE_TO_PARENT。
float pivotXValue:X坐标的伸缩值。
int pivotYType:Y轴的伸缩模式,可以取值为ABSOLUTE、RELATIVE_TO_SELF、RELATIVE_TO_PARENT。
参数说明:
float fromDegrees:旋转的开始角度。
float toDegrees:旋转的结束角度。
int pivotXType:X轴的伸缩模式,可以取值为ABSOLUTE、RELATIVE_TO_SELF、RELATIVE_TO_PARENT。
float pivotXValue:X坐标的伸缩值。
int pivotYType:Y轴的伸缩模式,可以取值为ABSOLUTE、RELATIVE_TO_SELF、RELATIVE_TO_PARENT。
float pivotYValue:Y坐标的伸缩值。
public class MainActivity extends Activity { ImageView image; Button start; Button cancel; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); image = (ImageView) findViewById(R.id.main_img); start = (Button) findViewById(R.id.main_start); cancel = (Button) findViewById(R.id.main_cancel); /** 设置旋转动画 */ final RotateAnimation animation =new RotateAnimation(0f,360f,Animation.RELATIVE_TO_SELF, 0.5f,Animation.RELATIVE_TO_SELF,0.5f); animation.setDuration(3000);//设置动画持续时间 /** 常用方法 */ //animation.setRepeatCount(int repeatCount);//设置重复次数 //animation.setFillAfter(boolean);//动画执行完后是否停留在执行完的状态 //animation.setStartOffset(long startOffset);//执行前的等待时间 start.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { image.setAnimation(animation); /** 开始动画 */ animation.startNow(); } }); cancel.setOnClickListener(new OnClickListener() { public void onClick(View v) { /** 结束动画 */ animation.cancel(); } }); } }
0 0
- Android 动画之RotateAnimation应用详解
- Android 动画之RotateAnimation应用详解
- Android 动画之RotateAnimation应用详解
- Android 动画之RotateAnimation应用详解
- Android 动画之RotateAnimation应用详解
- Android 动画之RotateAnimation应用详解
- Android 动画之RotateAnimation应用详解
- Android 动画之RotateAnimation应用详解
- Android 动画之RotateAnimation应用详解
- Android 动画之RotateAnimation应用详解
- Android 动画之RotateAnimation应用实例
- Android动画之RotateAnimation
- Android 动画之RotateAnimation应用详解(旋转动画效果 )(转载)
- Android Tween动画之RotateAnimation
- Android 常用动画之RotateAnimation
- Android动画之RotateAnimation使用
- Android 动画 Tweened Animation 之 RotateAnimation
- Android动画之RotateAnimation的基本用法
- 自定义ViewPagerIndictor
- Machine Learning Week3
- laravel路由组划分
- 【整理】JS中的History对象
- Delphi Project 之工程选项(Project Options)
- Android 动画之RotateAnimation应用详解
- JAVA SOCKET connect超时设置是如何实现的?
- 日间模式转换夜间模式
- 【电脑技术】:电脑黑屏的情况统计
- ovs bond选项情况
- Linux Used内存到底哪里去了?
- java SSM 框架 多数据源 代码生成器 websocket即时通讯 shiro redis 后台框架
- SpannableString与SpannableStringBuilder使用
- 走向设计(单例模式)