Paint paint = new Paint(); float strWidth = paint.measureText(String); 转载于:https://www.cnblogs.com/listened/p/4265862.html