Declare UIAlertView in .h file like following...
UIAlertView * alert;
-(void)alertProgress
{
alert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"wait..." delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];
UIActivityIndicatorView* activity = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
[alert addSubview:activity];
activity.center = CGPointMake(140,80);
activity.color = [UIColor whiteColor];
[activity startAnimating];
[alert show];
}
-(void)stopAlertProgress
{
[alert dismissWithClickedButtonIndex:0 animated:YES];
}
No comments:
Post a Comment