سؤال

I want my android app to support more languages (Hebrew), but I can't make the views appear on the right side of the scree (In Hebrew we write/read from right to left unlike English).

I tried android:layout_gravity="right" but it didn't work.

Is there a way to do this?

هل كانت مفيدة؟

المحلول

android:layout_gravity defines position of the view with respect to it's parent. android:gravity defines position of the child views of the current view.

So setting android:gravity will work for you

Also refer to following post to handle screens for multiple languages

How to get text direction in Android and change layout dynamically according to the direction?

Also try setting android:textDirection for RTL.

For more info you can go through following link:

http://android-developers.blogspot.in/2013/03/native-rtl-support-in-android-42.html

نصائح أخرى

You can align your text from right to left, for this add this attribute

android:gravity="right"

to your text view, it works only if your textview width is set to "fill_parent" or to a fixed dip. I cant point out a correct solution without seeing your layout, excuse if this solution dont work for you.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top