Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在 custom 垂直绘制文本View?如果我写像canvas.drawText("TEST", 0, 0, paint);. 文本将水平打印在画布上。如何将其旋转到垂直?谢谢。
View
canvas.drawText("TEST", 0, 0, paint);
我知道为时已晚,但是没有答案,所以我写了。
您可以使用path在一个路径上绘制文本
private val path = Path() path.moveTo(rect.centerX().toFloat(), height.toFloat()) path.lineTo(rect.centerX().toFloat(), 0F) canvas.drawTextOnPath("Lalit jadav Lalit jadav Lalit jadav", path, 0F, 0F, textPaint)