的WebView IFRAME溢出WebView、IFRAME

2023-09-06 00:32:43 作者:真心已在睡梦

我目前正在建设中的android一个Web应用程序。我的应用程序运行在一个web视图,并通过内置页框加载第三方内容。的IFRAME大小是固定的,应该不被加载的内容被改变。

I'm currently building a web app in android. My app runs in a webview, and loads third-party contents through iframes. The iframe size is fixed and supposed not to be changed by the content loaded.

在桌面Chrome浏览器,它工作正常和加载的内容溢出的部分可以通过滚动条滚动。然而,在Android的web视图,iframe中往往根据加载的内容,这导致了页面布局乱来调整自己。

In desktop Chrome browser, it works fine and the overflow part of loaded content can be scrolled via scrollbars. However, in android webview, the iframe tends to resize itself based on the contents loaded, which leads to a mess of the page layout.

有没有其他人遇到同样的问题?

Has anyone else encountered the same problem?

推荐答案

我找到了一个方法来避免这个讨厌的问题。我已禁用的iframe的滚动条,并使用 iscroll 应用程序来代替。这种滚动条几乎是一样的原单,虽然慢于我的HTC Magic手机。

I found out a way to avoid this nasty problem. I've disabled the scrolling bar of iframe, and use iscroll in the application instead. This scrolling bar is nearly the same as the original one, though slower on my HTC Magic phone.