lakshmen
lakshmen

Reputation: 29074

How to add a UIActivityIndicatorView inside a AlertView

I would like to show an alertview saying the process is in progress and would like to add the UIActivityIndicatorView inside the alertview to show the process is in progress, instead of outside the alertview. How do I do that? Any guidance will be helpful.

Upvotes: 1

Views: 300

Answers (2)

ibiren
ibiren

Reputation: 693

I would rather suggest you to use MBProgressHud

and if u need to show some image and text then, use this

Upvotes: 0

lakshmen
lakshmen

Reputation: 29074

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];

Upvotes: 2

Related Questions