我在写数字时遇到问题,使用阿拉伯语时,它们的位置与文本不同 请注意,在用英文写的情况下,不会发生错误
TextPaint mTextPaint = new TextPaint();
StaticLayout mTextLayout = new StaticLayout( textToSave ,mTextPaint, canvas.getWidth() - 100,
Layout.Alignment.ALIGN_NORMAL, 1.0f, 0.0f, false);
canvas.save();
int textX = 50;
int textY = 50;
canvas.translate(textX, textY);
mTextLayout.draw(canvas);
canvas.restore();