【发布时间】:2016-09-27 12:51:13
【问题描述】:
我使用了这个代码:
Rect bounds=new Rect();
tv.getPaint().getTextBounds(text,0, text.length(),bounds);
float textWidth=bounds.width();
float textHeight=bounds.height();
它在水平方向上运行良好...... 垂直尺寸也可以... 但是文字的绘制位置比我预期的要低...
这些链接没有用:
auto scale textview text to fit within bounds
我应该改变什么?
【问题讨论】: