6

A string as "123456" showed in the screen. I want to get the width of that string .

Joshua Wilson
  • 2,546
  • 1
  • 20
  • 28
fordreamxin
  • 125
  • 1
  • 7

1 Answers1

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