Android WebView JellyBean ->不应该发生:没有找到基于 rect 的测试节点 [英] Android WebView JellyBean -> Should not happen: no rect-based-test nodes found

查看:15
本文介绍了Android WebView JellyBean ->不应该发生:没有找到基于 rect 的测试节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序使用了大量 webview,它们位于 ViewPager 持有的片段中.

My application is using a lot of webviews which are lying in fragments which are hold by a ViewPager.

每当我在带有 Jellybean 的 Galaxy Nexus 上滑动应用程序时,我都会一次又一次地收到以下控制台消息:

Whenever i swipe through the app on my Galaxy Nexus with Jellybean on it i get the following console message again and again:

08-23 13:44:03.374: E/webcoreglue(21690): Should not happen: no rect-based-test nodes found

谁能向我解释这里出了什么问题,以便我能够解决问题?

Can anyone explain to me what is going wrong here so that i might be able to fix the issue?

推荐答案

出现这个问题是因为在某些情况下,WebView 没有注意到它的可见 rect 发生了变化,因此就 webkit 而言,该页面仍然不可见.因此,所有接触都落在窗口之外,并被拒绝.

The issue occurs because in some scenarios WebView fails to notice that its visible rect has changed, so as far as webkit is concerned the page is still not visible. Thus all touches fall outside of the window, and get rejected.

最干净的解决方法是当您知道 WebView 的可见性已更改时(例如响应来自 viewpager 的 setPrimaryItem 回调),调用 webview.onScrollChanged(webview.getScrollX(), webview.getScrollY());

The cleanest fix is when you know the visibility of your WebView has changed (such as in response to a setPrimaryItem callback from a viewpager), call webview.onScrollChanged(webview.getScrollX(), webview.getScrollY());

您需要对 webview 进行子类化以将受保护的 onScrollChanged 提升为公共方法.

You will need to subclass the webview to promote the protected onScrollChanged to a public method.

这篇关于Android WebView JellyBean ->不应该发生:没有找到基于 rect 的测试节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆