Skip to content Skip to sidebar Skip to footer

Android Arabic Text Alignment

I use class from How to support Arabic text in Android? to show Arabic text. In Android 2.1 - 2.3 text located in the left side, so I use android:gravity='right', but in Android 3.

Solution 1:

You can create different versions of the layouts for different API versions.

As you can read here: http://developer.android.com/guide/topics/resources/providing-resources.html you can have say the normal folder (/res/layout/) with the layout for old devices and then another one for the ones that support it: /res/layout-11/

The layout inside layout-v11 will only be applied on devices with android 3.0 and over.

Hope it helps. (UPD: API level changed to 11)

UPDATE

On Android 4.2 This is a native feature :)

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

Post a Comment for "Android Arabic Text Alignment"