Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding UIActivityindicatorView in an UIAlertView

Tags:

iphone

I want to create a UIAlertView that will say that "...in progress". It will also show that UIActivityindicatorView on it. Could you let me know how can I do that?

Thanks.

like image 885
ebaccount Avatar asked Jun 02 '09 18:06

ebaccount


1 Answers

Its pretty simple. Just create a UIActivityIndicatorView and add it as a subview to the UIAlertView.

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@" " message:@" " delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
    UIActivityIndicatorView *progress= [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125, 50, 30, 30)];
    progress.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
    [alert addSubview:progress];
    [progress startAnimating];

    [alert show];
like image 188
Brandon Schlenker Avatar answered Sep 21 '22 17:09

Brandon Schlenker