Android WebView Hardware Accelerated Keyboard Glit

2019-02-15 21:49发布

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条回答
男人必须洒脱
2楼-- · 2019-02-15 22:50

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.

查看更多
登录 后发表回答