RotateAnimation 动画设置

来源:互联网 发布:linux图形工作站 编辑:程序博客网 时间:2024/04/29 22:22
 private ImageView img_down;   //  初始化图片
 private RotateAnimation animation ;//初始化动画控件
 protected void beforeInitView() {
        animation = new RotateAnimation(0, -180, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f); //设置动画效果 
        animation.setDuration(50);//执行时间
        animation.setFillAfter(true);//停留在当前页面
    }
  img_down.clearAnimation();  //加载动画之前要清楚之前动画效果
  img_down.setAnimation(animation);//把动画效果加载到所选择的空间中去
0 0