您的位置:首页 > 移动开发 > Android开发

android 匀速旋转动画效果

2015-05-23 19:11 274 查看
在一个播放控件,上增加一个等待动画

LayoutParams mLayoutParams = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);

//将新的ImageView添加到viewGroup当中

//mLayoutParams.addRule(verb, anchor)

mLayoutParams.addRule(RelativeLayout.CENTER_IN_PARENT);

m_playWnd.addView(imageViewAdd, mLayoutParams);

// m_playWnd.add

AnimationSet animset = new AnimationSet(false);

RotateAnimation mrotate = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);

mrotate.setDuration(800);

//mrotate.setRepeatMode(repeatMode)

LinearInterpolator ddd = new LinearInterpolator();

mrotate.setInterpolator(ddd);

mrotate.setRepeatCount(10000);

mrotate.setFillAfter(true);

//LinearInterpolator lir = new LinearInterpolator();

// mrotate.setInterpolator(lir);

animset.addAnimation(mrotate);

imageViewAdd.startAnimation(animset);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: