Is It Correct To Invoke StringByEvaluatingJavaScriptFromString Of UIWebView In ViewDidLoad?
I need to set the background of webView at a time when the html has not loaded. In iOS 5.0 this code is correctly working: - (void)viewDidLoad { [super viewDidLoad]; [webVi
Solution 1:
In my case I used webview:webViewDidFinishLoad method to evaluate javascript. It was working correctly in 4.2 but since I haven't tested it in iOS 5, I am not sure about its working in that version.
Solution 2:
- hide the webview until it is not loaded and set a view behind it with your desired background-color.
- when your webview is loaded, show it and set the background color of the html inside the webview
Post a Comment for "Is It Correct To Invoke StringByEvaluatingJavaScriptFromString Of UIWebView In ViewDidLoad?"