简体   繁体   English

奇怪的UIWebView Bug /行为

[英]Strange UIWebView Bug/Behavior

We have a UIWebView in our app, displaying HTML data loaded from memory (not a file). 我们的应用程序中有一个UIWebView,显示从内存(而不是文件)加载的HTML数据。 We are experiencing some very strange bug/behavior. 我们正在经历一些非常奇怪的错误/行为。 Some pages take very long time to render (1-2 minutes). 有些页面需要很长时间才能渲染(1-2分钟)。 We looked at the source of the pages, and it is indeed very busy with badly written CSS and HTML (not in our control). 我们查看了页面的来源,并且确实非常忙于编写错误的CSS和HTML(不在我们的控制中)。 However, we noticed that if we set a webview to load a page, and then press the power button to shut the iPhone's screen, then immediately press the power button again, and go back to our app, the webview renders the page instantly. 但是,我们注意到如果我们设置webview来加载页面,然后按电源按钮关闭iPhone的屏幕,然后立即再次按下电源按钮,然后返回我们的应用程序,webview立即呈现页面。

Has anyone experienced this? 有没有人经历过这个? Any ideas what's going on? 有什么想法发生了什么?

So, uhm, forgot to answer this. 所以,嗯,忘了回答这个问题。 It ended up that some of our HTML data had images that were linking to internal organization URLs, which were not accessible outside. 最后,我们的一些HTML数据的图像链接到内部组织URL,这些URL无法在外部访问。 And since the web view did not ask the delegate whether it should load, we didn't know about those resources. 由于Web视图没有询问代表是否应该加载,因此我们不了解这些资源。 Pressing the power button caused the connections to drop, which made it render the page. 按电源按钮导致连接断开,这使得它呈现页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM