FontMetricsInt fontMetrics = deletePaint.getFontMetricsInt(); int baseline = rect.top + (rect.height() - (fontMetrics.bottom - fontMetrics.top))/2 - fontMetrics.top; deletePaint.setTextAlign(Paint.Align.CENTER); canvas.drawText(deleteText, rect.centerX(), baseline, deletePaint);
时间: 2024-10-21 19:00:49