Android阿拉伯文字对齐 [英] Android Arabic text alignment

查看:93
本文介绍了Android阿拉伯文字对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是如何在Android中支持阿拉伯文字?显示阿拉伯文字.在Android 2.1-2.3文本位于左侧,因此我使用android:gravity ="right",但是在Android 3.0+中,阿拉伯文本在右侧自动对齐,如果我使用android:gravity ="right",在左侧对齐.如何在不同的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 alignment in right side and if I use android:gravity="right" in will be alignment 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/guide/topics/resources/providing-resources.html ,您可以说普通文件夹(/res/layout/)具有旧设备的布局,然后是另一个文件夹,用于支持旧设备的布局:/res/layout-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/

layout-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

这篇关于Android阿拉伯文字对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆