简体   繁体   中英

Android views of the right side of the screen

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?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM