android 实现控件的旋转动画效果
2013-07-23 10:11
603 查看
在程序开发中有时候需要让某一个空间旋转一定角度,或者是无限旋转(类似Progressbar)。
其实实现起来也很简单:
然后就是控件的操作:
我实现的效果是你点击的你的button,然后你的button就会旋转45度。
其实实现起来也很简单:
RotateAnimation mFlipAnimation; mFlipAnimation = new RotateAnimation(0, 45, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f); mFlipAnimation.setInterpolator(new LinearInterpolator()); mFlipAnimation.setDuration(80);//如果参数是0,就是无限旋转 mFlipAnimation.setFillAfter(true);
然后就是控件的操作:
your_button.clearAnimation(); your_button.startAnimation(mFlipAnimation);
我实现的效果是你点击的你的button,然后你的button就会旋转45度。
相关文章推荐
- android 实现控件的旋转动画效果
- Android中使用Animation实现控件的动画效果以及Interpolator和AnimationListener的使用
- Android 补间动画,具体介绍了透明度、平移,旋转,缩放4种动画效果的实现,简单易懂
- Android基础-简单的动画实现 *补间动画 *透明度渐变 *旋转动画 *位移动画 *如果需要几个效果整合到一起,需要将所有效果全部放到set里
- Android自定义控件View(实现控件的动画效果,自定义类画简略时钟,TextView中文字逐一显示,动态设置progress的圆环/扇形ProgressBar等)
- Android中使用Animation实现控件的动画效果以及Interpolator和AnimationListener的使用
- Android中使用Animation实现控件的动画效果以及Interpolator和AnimationListener的使用
- Android基础-简单的动画实现 *补间动画 *透明度渐变 *旋转动画 *位移动画 *如果需要几个效果整合到一起,需要将所有效果全部放到set里
- android 动画rotate实现图片不停旋转的效果
- Android Tween动画之RotateAnimation实现图片不停旋转效果实例介绍
- Android基础控件——ProgressBar自定义的介绍、动画效果实现、附加三个漂亮的进度条
- android 控件动画效果实现
- android 视图动画的使用,Animation重写 实现旋转效果
- Android编程实现RotateAnimation设置中心点旋转动画效果
- Android中使用Animation实现控件的动画效果以及Interpolator和AnimationListener的使用
- Android进阶——自定义View之继承系统控件实现自带删除按钮动画效果和软键盘自动悬浮于文本框下方
- Android Tween动画之RotateAnimation实现图片不停旋转效果实例介绍
- Android仿饿了么加入购物车旋转控件自带闪转腾挪动画的按钮效果(实例详解)
- Android使用Rotate3dAnimation实现3D旋转动画效果的实例代码
- Android中使用Animation实现控件的动画效果以及Interpolator和AnimationListener的使用