我想创建一个显示"...in UIAlertView“的进度。它还将在其上显示UIActivityindicatorView。你能告诉我怎么做吗?
谢谢。
发布于 2009-06-02 20:28:39
这很简单。只需创建一个UIActivityIndicatorView并将其作为子视图添加到UIAlertView。
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@" " message:@" " delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
UIActivityIndicatorView *progress= [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(125, 50, 30, 30)];
progress.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge;
[alert addSubview:progress];
[progress startAnimating];
[alert show];
发布于 2013-07-16 14:16:35
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"" message:@"" delegate:self cancelButtonTitle:nil otherButtonTitles:nil];
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
spinner.center = CGRectMake(xcords, ycords, width, height);
[alert addSubview:spinner];
[spinner startanimating];
[alert show];
此微调器在关闭AlertView时被隐藏。
[alert dismissWithClickedButtonIndex:0 animated:YES];
https://stackoverflow.com/questions/941264
复制相似问题