Ethan
Ethan

Reputation: 2087

How to Mirror a TextView

Part of my application requires it to be compatible if somebody was looking at the screen via mirror. Does anybody know a way where I can mirror all of the text on screen? I have tried mirrorText.setLayoutDirection(View.LAYOUT_DIRECTION_RTL); but it hasn't worked. Thank you

Upvotes: 6

Views: 4094

Answers (1)

Ethan
Ethan

Reputation: 2087

This is very simple to accomplish. The code I used was:
Text.setScaleX(-1); Text.setScaleY(1); Text.setTranslationX(1); //To place everything back where it was originally. Hope this helps!

Upvotes: 18

Related Questions