如何使我的编辑文本类型从右到左? [英] How to make my edit text type right to left ?

查看:151
本文介绍了如何使我的编辑文本类型从右到左?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

其实,我的魔杖键入阿拉伯语,这可能吗?
我创建一个Android application.And我是新来it.please帮助。
我想这些code没有工作。

 如果(UTILSSessionVariables.LCID == 2057)
        {
        的setContentView(R.layout.passportdocumentfields);
 LastName.setGravity(Gravity.LEFT);
        }
否则,如果(UTILSSessionVariables.LCID == 3801)
        {
            的setContentView(R.layout.arabicpassportdetails);            LastName.setGravity(Gravity.RIGHT);
        }


解决方案

使用一个比迪对象来获取一个双向的文字,如阿拉伯语或希伯来语的位置重新排序的信息。这些语言水平文本的自然的显示顺序是从右到左,而他们订单号由左到右。

阅读以下文件: -

http://developer.android.com/reference/java/text/ Bidi.html

 的android:textDirection =anyRtl

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

I actually wand to type Arabic,Is it possible ? I am creating an android application.And i am new to it.please help. i tried these code it didn't work.

if(UTILSSessionVariables.LCID==2057)
        {
        setContentView(R.layout.passportdocumentfields);
 LastName.setGravity(Gravity.LEFT);
        }
else if(UTILSSessionVariables.LCID==3801)
        {
            setContentView(R.layout.arabicpassportdetails);

            LastName.setGravity(Gravity.RIGHT);
        } 

解决方案

Use a Bidi object to get the information on the position reordering of a bidirectional text, such as Arabic or Hebrew. The natural display ordering of horizontal text in these languages is from right to left, while they order numbers from left to right.

Read the below document :-

http://developer.android.com/reference/java/text/Bidi.html

or

android:textDirection="anyRtl"

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

这篇关于如何使我的编辑文本类型从右到左?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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