UIAlertView Dynamically in iPhone App

孤者浪人 提交于 2019-12-06 15:16:08

问题


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



来源:https://stackoverflow.com/questions/10186507/uialertview-dynamically-in-iphone-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!