Measuring text width to be drawn on Canvas ( Android )

前端 未结 7 1823
轮回少年
轮回少年 2020-12-12 16:18

Is there a method which returns the width ( in pixels ) of a text to be drawn on an Android canvas using the drawText() method according to the Paint used to draw it?

相关标签:
7条回答
  • 2020-12-12 16:46

    you can use "textPaint.getTextSize()" to get text width

    0 讨论(0)
提交回复
热议问题