onClick event in android webview too slow

后端 未结 2 840
刺人心
刺人心 2021-01-20 23:22

I\'ve got the feeling that javascript itself is pretty fast in an andorid webview, but there is a long delay between touching an element and the onclick event beeing fired.

2条回答
  •  时光取名叫无心
    2021-01-21 00:14

    This is a known 'issue' related to 300ms due to user tapping/zooming at display:

    http://updates.html5rocks.com/2013/12/300ms-tap-delay-gone-away

    In the near future, this seems to be solved, in static sized layouts, adding information at header. But the actual webkit webview version does not have/consider this option.

    In my case, the solution was use Tappy lib:

    https://github.com/filamentgroup/tappy

    Just import it, and bind to each element that has an click event, and you will see the difference.

    Just one more point: I adjusted the timer to 100000ms (default:1000ms) to avoid event repetition in some specific cases.

提交回复
热议问题