Change android input method for WebView

廉价感情. 提交于 2019-12-10 10:53:43

问题


I have a WebView that loads a webpage with a form and would like to use the most basic keyboard possible in order to conserve screen real estate if they are using the onscreen keyboard as their input method. I would also like to disable things like word suggestions in the onscreen keyboard. Is this possible?


回答1:


You cannot change the input method, anywhere -- only users can change their input method.

In terms of disabling search suggestions, I haven't seen any hooks to change that behavior that are exposed from WebView, sorry.




回答2:


I think you can add some attributes to the HTMl component that will make what you want. This works in the Android devices I have tested (Samsung Galaxy 4 and Nexus 7), but I would not be surprised if this does not work in other devices.

<input autocorrect="off" autocapitalize="off" autocomplete="off" spellcheck="false"> test

<textarea spellcheck="false" autocorrect="off" autocapitalize="off" autocomplete="off"> test </textarea>


来源:https://stackoverflow.com/questions/6482001/change-android-input-method-for-webview

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