我想用觸摸監聽器在屏幕上繪製一條線,但是當我嘗試再次畫線時,它會擦除上一行。我正在使用此代碼: -畫線 - Android
我無法找到問題的解決方案。
public class Drawer extends View
{
public Drawer(Context context)
{
super(context);
}
protected void onDraw(Canvas canvas)
{
Paint p = new Paint();
p.setColor(colordraw);
canvas.drawLine(x1, y1, x2, y2, p);
invalidate();
}
}
發佈多次http://stackoverflow.com/questions/6372556/android-draw-line – Matthieu 2011-06-16 13:45:50