1、直接获取:
paint.measureText(yourString);
2、把字符串放到矩形中:
Paint paint = new Paint();Rect rect = new Rect();
paint.getTextBounds(yourString, 0, 1, rect);
字符串宽度=rect.width();
字符串高度=rect.height();
1、直接获取:
paint.measureText(yourString);
2、把字符串放到矩形中:
Paint paint = new Paint();