在画布上要绘制测量文本的宽度(安卓)画布、宽度、上要、测量

2023-09-12 07:05:52 作者:不期而遇

有返回文本的宽度(以像素为单位),将根据用于绘制其上的油漆使用的drawText()方法的一个Android画布上绘制的方法?

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?

推荐答案

你看android.graphics.Paint.measureText(String TXT)?