Android 计算文本占用高度 发表于 2014-02-10 更新于 2022-11-07 分类于 Android开发 Paint paint = new Paint(); paint.setTextSize(fontSize); FontMetrics fm = paint.getFontMetrics(); int textHeight=(int) Math.ceil(fm.descent - fm.top) ;