3
我想在Android上的畫布上連續旋轉圓圈。我正在使用畫布繪製圓圈,並且我正在不斷旋轉圓圈。有可能的話,如果可能的話, 與代碼或示例可以幫助我非常感謝!如何在畫布上旋轉圓圈動畫
這裏是我的代碼在畫布上繪製圓:提前
import android.app.Activity;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Bundle;
import android.view.View;
public class AnimationActivity extends Activity {
/** Called when the activity is first created. */
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(new SampleView(this));
}
public class SampleView extends View
{
public SampleView(Context context)
{
super(context);
// TODO Auto-generated constructor stub
}
@Override
protected void onDraw(Canvas canvas)
{
Paint mPaint = new Paint();
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeWidth(10);
mPaint.setColor(Color.RED);
canvas.drawCircle(75, 75, 75, mPaint);
}
}
}
謝謝!
使用http://developer.android.com/reference/android/view/animation/RotateAnimation.html RotateAnimation –