如何在转换之前强制UIWebView加载 [英] How to force UIWebView to load before transition
本文介绍了如何在转换之前强制UIWebView加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
iOS 6.1
点击按钮时,我想执行从imageview到webview的转换。
问题是,第一次加载webview时,页面为白色,html页面在过渡后加载:
When a button is tapped, I want to perform a transition from an imageview to a webview. The problem is that the very first time the webview loads, the page is white and the html page loads after the transition:
NepContainerView *containerInFrame = (NepContainerView *)[self view];
UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.frame];
[webView loadHTMLString:html baseURL:nil];
[UIView transitionWithView:containerInFrame
duration:DURATION_TRANS_PHOTO_DESC
options:UIViewAnimationOptionTransitionFlipFromLeft
animations:^{
[containerInFrame addSubview:webView];
[sender setTitle:@" Photo "];
}
completion:NULL];
如何强制html页面在转换之前加载 ?
How can I force the html page to be loaded before the transition?
推荐答案
你也可以使用这个 WebContentView 库。
此库有一个名为
+ (void)preloadContent:(NSString *)content;
您可以使用此方法预加载内容,以便快速呈现内容。
You can use this method to preload the content so that it will render fast.
希望它有所帮助。
这是一个有用的链接,可以帮助你
Here is the useful link that will help you
这篇关于如何在转换之前强制UIWebView加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文