Nadav Rosenberg
Nadav Rosenberg

Reputation: 101

textview not right to left although right to left device

I'm building an app that will work both for RTL and for LTR on local direction , i work with a RTL device (HEBREW) and all views are RTL ok. but on another device a bit newer all views that's text is in Hebrew are right to left but in English they are left to right they supposed to be right to left even if they are in English , already tested on 2 newer phones and yeah this problem again.

please help.

Upvotes: 1

Views: 147

Answers (2)

Milan Joseph
Milan Joseph

Reputation: 118

While working with an app that supports both RTL and LTR, Use values for gravity as START and END

Upvotes: 0

Omar Mneimneh
Omar Mneimneh

Reputation: 466

You can change gravity in XML:

<TextView android:width="wrap_content"
          android:height="wrap_content"
          android:text="example"
          android:gravity="right"/>

You can also change it in code:

textView.setGravity(Gravity.RIGHT);

Upvotes: 1

Related Questions