UIAlertView Dynamically in iPhone App

2019-04-16 22:46发布

问题:

I want to display dynamic UIAlertView and Indicator within it when data is loading from web-service. Also I don't want any button on UIAlertView. And it will be stopped automatically when data will be loaded successfully.

How can I implement it.?

回答1:

If you are using WebView then write startAnimating ActivityIndicator in ViewDidLoad and this delegate method will call by itself when your data will be loaded

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
   //[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
   [ActivityIndicator stopAnimating];    
}

Hope it helps.Thanks :)



回答2:

Just declar UIAlertView and then your activity indicator, make indicator a sub view to alert view and then when your data has been loaded from web service dismiss with this instance method

 – dismissWithClickedButtonIndex:animated:


回答3:

Then use MBProgress HUD or SVprogress HUD

https://github.com/jdg/MBProgressHUD