用drawCircle在画布上绘制的圆圈内绘制数字的最佳方法是什么?
然后这个圈子可以被用户拖动,当圈子为空时我没有问题。
This will draw text centered at centerX, centerY
Rect rect = new Rect();
paint.getTextBounds(text, 0, text.length(), rect);
float x = centerX - rect.width() / 2;
FontMetrics fm = paint.getFontMetrics();
float y= centerY - (fm.descent + fm.ascent) / 2;
canvas.drawText(text, x, y, paint);