How do I add a "load" screen for the UIWebView app every time a new page is loaded?
I have an app that works with tabs and webview. I already have a setup to refresh the page assigned to the tab every time an item in the tab is selected. My problem is that it takes a while for the page to load and it is impossible to tell if the displayed page is old or updated.
What I want to do is add a loading screen (simple image) to be displayed before the updated page loads. Here is the function that I run on each tab:
- (void) goToPage:(NSString *)sid
{
NSString *newURL = [NSString stringWithFormat:@"%@/mykingdom.php?sid=%@", appURL, sid];
[secondView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:newURL]]];
}
Thanks!
a source to share
The preferred user interface is to display a large UIActivityIndicatorView. This is a "gear" that rotates the backlight, as if turning.
If you want something else, you can simply display the modal view through the UIWebView with some graphics in it, then fire it when the webview announces itself.
If you want the web view to display something, the simplest way would be to have web views showing the download page and another load of the actual page. Change them as needed. This turns around having to manage the upload to string and then upload to the web view, which can sometimes be confusing for complex web attractions.
a source to share