我用类从如何支持阿拉伯文字中的Android?显示阿拉伯文字。在安卓2.1 - 2.3文本位于左侧,所以我用安卓重力=正确的,但在安卓3.0+阿拉伯文文本已经自动aligment在右边,如果我用安卓重力=右将aligment在左侧。我怎样才能让文字与同对准不同的Android版本?
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.0+ Arabic text has automatically aligment in right side and if I use android:gravity="right" in will be aligment in the left side. How can I make the text to be aligned with the same in different Android versions?
您可以创建不同版本的布局不同的API的版本。
You can create different versions of the layouts for different API versions.
正如你可以在这里阅读: http://developer.android。 COM /引导/主题/资源/提供-resources.html 你可以说,正常的文件夹( / RES /布局/
)与老设备的布局然后又是一个用于支持它的那些: / RES /布局-11 /
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/
在布局-V11布局
将只与Android 3.0及以上设备的应用。
The layout inside layout-v11
will only be applied on devices with android 3.0 and over.
希望它帮助。 (UPD:API级别改为11)
Hope it helps. (UPD: API level changed to 11)
更新
在Android 4.2以下是本机的功能:)
On Android 4.2 This is a native feature :)
的http://android-developers.blogspot.com.es/2013/03/native-rtl-support-in-android-42.html