`

Get string width and height in Android

 
阅读更多
Rect bounds = new Rect();

Paint textPaint = textView.getPaint();

textPaint.getTextBounds(text,0,text.length(),bounds);

int height = bounds.height();

int width = bounds.width();
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics