的WebView内ViewPager或滚动型 - Android电子奇怪的渲染错误3.0+ [英] WebView inside ViewPager or ScrollView - weird rendering bug on Android 3.0+

查看:571
本文介绍了的WebView内ViewPager或滚动型 - Android电子奇怪的渲染错误3.0+的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ViewPager。在ViewPager的每一页是滚动型。滚动视图中包含的WebView和其他一些意见。

I have a ViewPager. Every page of the ViewPager is a ScrollView. The ScrollView contains a WebView and several other Views.

在Android 2.3及以上的一切工作正常,但在3.0+有一个奇怪的渲染问题:

On Android 2.3 and older everything works fine but on 3.0+ there's a weird rendering issue:

在右侧的ViewPager滚动左/,也有一个非常微妙的呈现的问题(这是在Android 4.0的Gmail应用程序present太)。

When scrolling left / right in the ViewPager, there is also a very subtle rendering issue (which is present in Android 4.0 Gmail app too).

推荐答案

我部分地滚动型解决它通过调用 webView.requestLayout()。 onScrollChanged()。它现在几乎确定,但滚动时,在的WebView 略显出与其他滚动型儿童同步。有时的WebView 似乎稍微滚动慢于其他视图和跟上他们片刻之后。

I partially solved it by calling webView.requestLayout() in ScrollView.onScrollChanged(). It is now almost ok, but when scrolling, the WebView seems slightly out of sync with other ScrollView children. Sometimes the WebView seems to scroll slightly slowly than other Views and catches up with them a moment later.

这篇关于的WebView内ViewPager或滚动型 - Android电子奇怪的渲染错误3.0+的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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