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