安卓WebView硬件加速键盘的故障[英] Android WebView Hardware Accelerated Keyboard Glitch

本文是小编为大家收集整理的关于安卓WebView硬件加速键盘的故障的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

当WebView加速硬件时,单击输入字段会导致键盘出现,并且将HTML重新换档并重复了一会儿:

1)当软键盘出现WebView时,其内容将其内容放在左下,然后再次到正常位置.引起简短的可查看重复.

2)更改键盘(例如ABC->数字)时,内容将通过键盘高度向下放置,然后返回正常位置.引起简短的可查看重复.

在两个Android 4.0平板电脑上测试,如果关闭硬件加速度,则不会出现此类故障.

我未能找到有关此的任何信息,有人遇到了同样的问题吗?

推荐答案

所以我终于找到了一些解决方案:

  1. 整个WebView内容通过布局保证金宽度移动,因此将其设置为0px解决此问题.

  2. android:windowSoftInputMode="adjustPan"用于WebView活动.

本文地址:https://www.itbaoku.cn/post/102633.html

问题描述

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:

  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.