0
votes

I have 2 ViewControllers A and B controlled by UINavigationController. In B view controller I have UIWebView. I pass data form A to B. I push B view controller. And in B viewDidLoad method I set data to UIWebView. The loadHTMLString (which I use to set data) method in UIWebView controller is async so when I push view controller B to UINavigatorController I see a little delay/blank screen/flickering because my data is still rendering in UIWebView despite B ViewController already pushed. So what is solution to avoid blank screen/flickering ?

1

1 Answers

1
votes

Maybe hide webView (webView.hidden = YES) until – webViewDidFinishLoad: method (in this metod just set webView.hidden = NO) of UIWebViewDelegate will be called, will be halpfull for you. Or, you can use – stringByEvaluatingJavaScriptFromString: method for set background, its describes in this question Is it correct to invoke stringByEvaluatingJavaScriptFromString of UIWebView in viewDidLoad?