问题
I am using WebView to present UI. Is there any way that I can trigger custom soft keyboard when input text form field is selected?
回答1:
I just encounter a similar problem with the android WebView. When I select, in touch mode, a text input field, it does not pop-up the virtual keyboard whereas with the trackball it works fine.
I just found there: http://groups.google.com/group/android-developers/browse_thread/thread/e52109afda599301/b4cbc16e4e9e8e0d (last message from alien9) that calling
myWebview.requestFocusFromTouch();
solve the problem.
回答2:
take a look at HTML5 - if you change your
<input type="text" ...
to for instance a
<input type="number" ...
you'll get a specialized soft keyboard for numbers.
Here is some more documentation: http://diveintohtml5.ep.io/forms.html
来源:https://stackoverflow.com/questions/3098186/android-how-to-add-custom-soft-keyboard-when-form-field-is-selected-in-webview