2013-03-12 60 views

回答

7

使用此代碼,給

Rect bounds = new Rect(); Paint textPaint = textView.getPaint(); 
textPaint.getTextBounds(text,0,text.length(),bounds); 
int height = bounds.height(); 
int width = bounds.width(); 

標題有誤導之嫌。一個android開發人員不一定會想到windows方法GetTextExtentPoint()。請編輯它。

+0

完美。 – Ganesh 2014-04-10 12:39:47