当前位置 : 主页 > 编程语言 > python >

[IOS] iphone 弹出加载中对话框 UIAlertView

来源:互联网 收集:自由互联 发布时间:2023-03-22
//显示加载中对话框 - (void)dialogShow { baseAlert = [[UIAlertView alloc] initWithTitle:@"Loading" message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil]; [baseAlert show]; //Create and add the activity indicator UIA

//显示加载中对话框 - (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]; }
上一篇:[IOS] Objective-C 字符处理函数
下一篇:没有了
网友评论