问题描述
当WebView加速硬件时,单击输入字段会导致键盘出现,并且将HTML重新换档并重复了一会儿:
1)当软键盘出现WebView时,其内容将其内容放在左下,然后再次到正常位置.引起简短的可查看重复.
2)更改键盘(例如ABC->数字)时,内容将通过键盘高度向下放置,然后返回正常位置.引起简短的可查看重复.
在两个Android 4.0平板电脑上测试,如果关闭硬件加速度,则不会出现此类故障.
我未能找到有关此的任何信息,有人遇到了同样的问题吗?
推荐答案
所以我终于找到了一些解决方案:
-
整个WebView内容通过布局保证金宽度移动,因此将其设置为0px解决此问题.
-
android:windowSoftInputMode="adjustPan"用于WebView活动.
问题描述
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?
推荐答案
So I finally found some solutions:
The entire WebView content moves by layout margin width, so setting it to 0px fixes this problem.
android:windowSoftInputMode="adjustPan" for WebView activity.