简体   繁体   English

如何在Crosswalk Web视图上更改用于输入电子邮件的Android键盘语言

[英]How to change Android keyboard language for input emails on a Crosswalk webview

We have a 4.2 android app working in different languages. 我们有一个使用不同语言的4.2 android应用程序。 In the greek language, emails are written with the latin alphabet so we need the keyboard showing up for those fields to be in English, and in any other field, in Greek. 在希腊语中,电子邮件是用拉丁字母书写的,因此我们需要使用键盘来显示这些字段,以便英语和其他任何字段都使用希腊语。

The webapp specifies those email fields as input type="email" but the keyboard showing up is in greek, with the @ symbol though. Web应用程序将这些电子邮件字段指定为input type="email"但显示的键盘为希腊语,但带有@符号。

So, we need to show a different keyboard than the system language on the email field (as in Greece, people don't have emails with greek chars) 因此,我们需要在电子邮件字段上显示与系统语言不同的键盘(例如在希腊,人们没有使用希腊字符的电子邮件)

I've thought about capturing the click event for those fields in the crosswalk activity and change the keyboard there (with something like this ), but I'm not sure if it'd be the correct way of doing it or if it'd work. 我已经考虑过要在人行横道活动中捕获这些字段的click事件并在那里更改键盘(使用类似这样的东西),但是我不确定这是否是正确的方法或是否会工作。

Thanks in advance! 提前致谢!

I've just discovered this flag which describes your problem: http://developer.android.com/reference/android/view/inputmethod/EditorInfo.html#IME_FLAG_FORCE_ASCII 我刚刚发现了描述您问题的标志: http : //developer.android.com/reference/android/view/inputmethod/EditorInfo.html#IME_FLAG_FORCE_ASCII

[...] For instance, users of languages using a different script like Arabic, Greek, Hebrew or Russian typically have a keyboard that can't input ASCII characters by default. [...]

In a native app, you could configure the keyboard specifying an imeOptions in the EditText (see http://developer.android.com/training/keyboard-input/style.html#Action ). 在本机应用程序中,您可以配置键盘,以在EditText中指定imeOptions (请参阅http://developer.android.com/training/keyboard-input/style.html#Action )。 Not sure if you could plug that in via a Cordova plugin or any other method into your hybrid app. 不知道是否可以通过Cordova插件或任何其他方法将其插入混合应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM