A string as "123456" showed in the screen. I want to get the width of that string .
Asked
Active
Viewed 5,625 times
6
-
http://stackoverflow.com/a/3630331/983741 CHeck this – Sunil Mishra Nov 20 '13 at 06:41
1 Answers
11
I dont tried, but maybe something like that:
mPaint = new Paint();
mPaint.setTextSize(64);
//...
float width = mPaint.measureText(text, 0, text.length());

kai
- 534
- 4
- 12