当我关注webview输入字段时,我的软键盘不显示此按钮.没有找到任何关于特殊设置来启用此功能 – 我错过了什么吗?它不会出现在任何类型的输入字段(字母/数字)中.
Android版本4.0.3
提前致谢!
解决方法
以下是帮助我(Nexus 4和Nexus 5与Android 4.4.*),使用自定义WebView并覆盖onCreateInputConnection()的EditInfo:
private static class CustomWebView extends WebView { public CustomWebView(Context context) { super(context); } @Override public InputConnection onCreateInputConnection(EditorInfo outAttrs) { InputConnection inputConnection = super.onCreateInputConnection(outAttrs); if (outAttrs != null) { // remove other IME_ACTION_* outAttrs.imeOptions &= ~EditorInfo.IME_ACTION_GO; outAttrs.imeOptions &= ~EditorInfo.IME_ACTION_SEARCH; outAttrs.imeOptions &= ~EditorInfo.IME_ACTION_SEND; outAttrs.imeOptions &= ~EditorInfo.IME_ACTION_DONE; outAttrs.imeOptions &= ~EditorInfo.IME_ACTION_NONE; // add IME_ACTION_NEXT instead outAttrs.imeOptions |= EditorInfo.IME_ACTION_NEXT; } return inputConnection; } }