4
我想在Android畫布上爲單個路徑創建動畫。Android:在畫布上爲單個路徑的Alpha創建動畫
public class MyView extends View {
private Path paths[];
protected void onDraw(Canvas canvas) {
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(8);
paint.setColor(Color.BLUE);
Path path = new Path();
path.moveTo(75, 11);
path.quadTo(62, 87, 10, 144);
canvas.drawPath(path, paint);
paths[0] = path;
path.reset();
path.moveTo(50, 100);
path.lineTo(150, 200);
canvas.drawPath(path, paint);
paths[1] = path;
}
}
現在我有路徑[],我想單獨爲每一個動畫。我希望它能夠像增長一樣改變alpha。起初只有一點點,然後它成長爲一條線,重複。
可以這樣做嗎?
怎麼樣?
你解決呢? – 2011-04-09 20:03:30