Android Arabic Cursor Split

爷,独闯天下 提交于 2019-12-24 01:01:45

问题


I'm using a custom EditText because client wants to force arabic locale globally in the app.

Here is the code I use in the constructor of the EditText:

setTextDirection(TEXT_DIRECTION_LOCALE);

It works perfectly, but I have a strange behavior of the cursor as you can see in the image

Somebody knows if it's normal or how can I solve this?

Thank you


回答1:


Found the solution there: https://ux.stackexchange.com/a/39639 Apparently, it's the normal behavior when you have rtl and ltr text mixed.




回答2:


This is the normal behaviour. But if you still want to forcefully acheive this, than this worked for me:

ViewCompat.setLayoutDirection(edtEmail, ViewCompat.LAYOUT_DIRECTION_LTR);

along with the gravity field



来源:https://stackoverflow.com/questions/35011074/android-arabic-cursor-split

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