iPhone上如何用UIAlertView实现加载中对话框功能?

2026-04-20 00:291阅读0评论SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计131个文字,预计阅读时间需要1分钟。

iPhone上如何用UIAlertView实现加载中对话框功能?

python// 显示加载对话框void dialogShow() { baseAlert=[[UIAlertView alloc] initWithTitle:@Loading message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil]; [baseAlert show]; // 创建并添加活动指示器 UIActivityIndicatorView}

iPhone上如何用UIAlertView实现加载中对话框功能?

//显示加载中对话框 - (void)dialogShow { baseAlert = [[UIAlertView alloc] initWithTitle:@"Loading" message:nil delegate:self cancelButtonTitle:nil 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]; }

本文共计131个文字,预计阅读时间需要1分钟。

iPhone上如何用UIAlertView实现加载中对话框功能?

python// 显示加载对话框void dialogShow() { baseAlert=[[UIAlertView alloc] initWithTitle:@Loading message:nil delegate:self cancelButtonTitle:nil otherButtonTitles:nil]; [baseAlert show]; // 创建并添加活动指示器 UIActivityIndicatorView}

iPhone上如何用UIAlertView实现加载中对话框功能?

//显示加载中对话框 - (void)dialogShow { baseAlert = [[UIAlertView alloc] initWithTitle:@"Loading" message:nil delegate:self cancelButtonTitle:nil 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]; }