如何在AlertView中添加UIActivityIndi​​catorView

时间:2012-12-12 10:54:21

标签: ios uialertview uiactivityindicatorview

我想显示一个alertview,说明该过程正在进行中,并希望在alertview中添加UIActivityIndi​​catorView以显示进程正在进行,而不是在alertview之外。我怎么做?任何指导都会有所帮助。

2 个答案:

答案 0 :(得分:2)

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@" "Process in Progress..." " ];
UIActivityIndicatorView *progress= [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125, 50, 30, 30)];
progress.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
[alert addSubview:progress];
[progress startAnimating];
[alert show];

答案 1 :(得分:0)

我建议您使用MBProgressHud

如果你需要显示一些图像和文字,那么use this

相关问题