// 计算出该TextView中文字的长度(像素)
public static float getTextViewLength(TextView textView,String text){
TextPaint paint = textView.getPaint();
// 得到使用该paint写上text的时候,像素为多少
float textLength = paint.measureText(text);
return textLength;
}
public static float getTextViewLength(TextView textView,String text){
TextPaint paint = textView.getPaint();
// 得到使用该paint写上text的时候,像素为多少
float textLength = paint.measureText(text);
return textLength;
}