📜  android paint drawtext multiline - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:43.855000             🧑  作者: Mango

代码示例1
// Kotlin language
val fm = paint.fontMetrics
val lineHeight = fm.bottom - fm.top + fm.leading
mText.split("\n").forEachIndexed { idx, line ->
    val baseline = idx * lineHeight + (-fm.top)  // fm.top is negative
    canvas.drawText(line, 0f, baseline, paint)
}