4

I am using a StaticLayout and using some RTL text. The problem is that it's not handling RTL well. In TextView you can set a "textDirection". is there any way to do it here too? Thanks!

Paebbels
  • 15,573
  • 13
  • 70
  • 139
roiberg
  • 13,629
  • 12
  • 60
  • 91

2 Answers2

2

Try using the left-to-right mark in the string:

left-to-right mark: ‎ or ‎ (U+200E)
right-to-left mark: ‏ or ‏ (U+200F)

So in your string try usןמע in the following way

String rtl = "\u200F ימין לשמאל";
galvan
  • 7,400
  • 7
  • 38
  • 55
-2

I had the same problem, it solved by changing

android:layout_width="wrap_content"

to

android:layout_width="match_parent"

in TextView tag.

I hope this help.

M.mirzaie
  • 1
  • 2