android EditText android:textDirection

。_饼干妹妹 提交于 2021-02-19 01:09:04

问题


I'd like to set an EditText to be LTR at all times, how do I do that? android:textDirection does seem to be the answer, i cant get the project to compile with that directive


回答1:


use gravity for the editText

android:gravity="right"



回答2:


Adding \u202D (LTR OVERRIDE) to the beginning of the string does the trick




回答3:


use direction for the editText

android:textDirection="ltr"



回答4:


Add these to your EditText:

android:gravity="left"
android:textDirection="ltr"

Note: android:textDirection requires API level 17



来源:https://stackoverflow.com/questions/12763508/android-edittext-androidtextdirection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!