现在的位置: 首页 > 综合 > 正文

(柯昌合)旋转动画(柯昌合)

2013年06月30日 ⁄ 综合 ⁄ 共 614字 ⁄ 字号 评论关闭
rotate_and_scale.xml
<?xml version="1.0" encoding="utf-8"?>

<set xmlns:android="http://schemas.android.com/apk/res/android">
    <rotate android:fromDegrees="0" android:toDegrees="360"
	android:pivotX="50%" android:pivotY="50%"
	android:duration="5000"
	android:repeatMode="restart"
	android:repeatCount="infinite" />
</set>

 
final ImageView img1=(ImageView)this.findViewById(R.id.imageView1);
Button btn=(Button)this.findViewById(R.id.button1);
final Animation mRotateAnim= AnimationUtils.loadAnimation(this, R.anim.rotate_and_scale);
btn.setOnClickListener(new OnClickListener() {
			
	@Override
	public void onClick(View v) {
		img1.setAnimation(mRotateAnim);
	}
});

抱歉!评论已关闭.