Android WebView Hardware Accelerated Keyboard Glitch

白昼怎懂夜的黑 提交于 2019-11-30 20:47:50

问题


When WebView is hardware accelerated, clicking on input field causes keyboard to appear and html is redrawed shifted and duplicated for a moment:

1) When soft keyboard is appearing WebView pans its content to bottom-left, then againt to normal position. Causes short view-able duplication.

2) When changing keyboards (ex. abc->numbers) contents are panned down by keyboard height and then back to normal position. Causes short view-able duplication.

Tested on two Android 4.0 tablets, if hardware accelerations is turned off no such glitches appear.

I failed to found any information on this, has anyone experienced same problem?


回答1:


So I finally found some solutions:

  1. The entire WebView content moves by layout margin width, so setting it to 0px fixes this problem.

  2. android:windowSoftInputMode="adjustPan" for WebView activity.



来源:https://stackoverflow.com/questions/10946086/android-webview-hardware-accelerated-keyboard-glitch

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