Voloda2 Voloda2 - 3 months ago 29
iOS Question

How can I show alertview with activity indicator?

I want to show alertview with message: "Loading data" and spinning activity indicator. How can I do this?

Sat Sat

you can add a label and activityindicator as subviews of your alert view. you have to do some thing like this

myAlertView = [[UIAlertView alloc] initWithTitle:@"Loading" message:@"\n\n"
                               otherButtonTitles:@"OK", nil];  

UIActivityIndicatorView *loading = [[UIActivityIndicatorView alloc]
loading.frame=CGRectMake(150, 150, 16, 16);
[myAlertView addSubview:loading];
[myAlertView show];

..better to use a UIActionSheet in this situation...