Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在画布上使用画布上的路径绘制文本,现在我想在最后一个字符串上添加新字符串,但新字符串会覆盖最后一个字符串,我想清除最后一个字符串,然后编写新字符串。
我将如何得到这个任何建议...
您必须使画布无效才能重绘它。
public setText(String text) { mText = text; this.invalidate(); } public void onDraw(Canvas canvas) { super.onDraw(canvas); ... canvas.drawText(mText, x, y, paint); }