如何镜像TextView

Eth*_*han 4 android android-layout

如果有人通过镜像查看屏幕,我的部分应用程序要求它兼容.有人知道我可以在屏幕上镜像所有文本的方式吗?我试过mirrorText.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);但它没有奏效.谢谢

Eth*_*han 8

这很容易实现.我使用的代码是:
Text.setScaleX(-1); Text.setScaleY(1); Text.setTranslationX(1); //To place everything back where it was originally. 希望这有帮助!