自定义view中获取字符串的宽度和高度 方法1:
Paint p = new Paint();String str = "abcdefg";float width = p.measureText(str);//获得字符串的宽度