`
zheyiw
  • 浏览: 997281 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

iphone 弹出加载中对话框 UIAlertView

阅读更多

//显示加载中对话框
- (void)dialogShow {    
    baseAlert = [[UIAlertView alloc] initWithTitle:@"Please Wait" message:@"\n\n\n" delegate:self cancelButtonTitle:@"close" otherButtonTitles: nil];
    [baseAlert show];
    
    //Create and add the activity indicator
    UIActivityIndicatorView *aiv = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    aiv.center = CGPointMake(baseAlert.bounds.origin.x + baseAlert.bounds.size.width/2, baseAlert.bounds.origin.y +baseAlert.bounds.size.height/2);
    [aiv startAnimating];
    [baseAlert addSubview:aiv];  
    
    //Auto dismiss after 3 seconds
	//[self performSelector:@selector(dialogDismiss) withObject:nil afterDelay:3.0f];
}
//取消对话框显示
- (void) dialogDismiss {
    [baseAlert dismissWithClickedButtonIndex:0 animated:NO];
}

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics