String str = "Hello"; |
资料:
- http://www.eoeandroid.com/thread-13672-1-1.html?_dsign=773b5e0d
- http://blog.csdn.net/chuekup/article/details/7518239
measureText()比getTextBounds多加上了左右的间距(Advance value)
http://stackoverflow.com/questions/7549182/android-paint-measuretext-vs-gettextbounds
getTextWidths() :Return the advance widths for the characters in the string。
主要看回答中的两张图就明白了。
http://stackoverflow.com/questions/20103312/paint-gettextwidths-what-is-advance-width
所以measureText()和getTextWidths()方法获取的宽度是相同的,测试过了。