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.
如何使用 Canvas.drawText 从右到左(即以相反的顺序)输出文本?有办法吗?
在您的对象中设置Paint.Align属性textPaint,如果您将其设置为 RIGHT -- 文本绘制到 x,y 原点的左侧:
Paint.Align
textPaint
textPaint.setTextAlign(Paint.Align.RIGHT); canvas.drawText("your text here", getRight(), getY()/2, textPaint);
看看这个:如何在位图上绘制 RTL 文本(阿拉伯语)并正确排序?