UIAlert + UIActivityIndicator 无按钮警告框


- (void) performDismiss
{
    [baseAlert dismissWithClickedButtonIndex:0 animated:NO];
}

- (void) action: (UIBarButtonItem *) item
{

    baseAlert = [[[UIAlertView alloc] initWithTitle:@"Please Wait" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] autorelease];
    [baseAlert show];

    // Create and add the activity indicator
    UIActivityIndicatorView *aiv = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    aiv.center = CGPointMake(baseAlert.bounds.size.width / 2.0f, baseAlert.bounds.size.height - 40.0f);
    [aiv startAnimating];
    [baseA
lert addSubview:aiv];
    [aiv release];

    // Auto dismiss after 3 seconds
    [self performSelector:@selector(performDismiss) withObject:nil afterDelay:3.0f];
}


UIAlert + UIActivityIndicator 无按钮警告框_第1张图片

你可能感兴趣的:(UIAlert + UIActivityIndicator 无按钮警告框)