【发布时间】:2013-10-04 12:43:54
【问题描述】:
我通过将进度视图和标签作为子视图添加到警报视图来显示进度视图和标签,这在 IOS6 上运行良好,我在 IOS7 上测试了相同的东西,但进度视图和标签没有显示。下面是我的代码。需要进行哪些更改才能使其在 ios7 上运行?
alert = [[UIAlertView alloc] initWithTitle:@"Please Wait..Downloading reports..." message:nil delegate:self cancelButtonTitle:nil otherButtonTitles: nil] ;
alert.frame=CGRectMake(50, 50, 280, 40);
prgView = [[UIProgressView alloc]initWithProgressViewStyle:UIProgressViewStyleBar];
prgView.frame = CGRectMake(10, 60, 265, 20);
prgView.hidden=NO;
[alert addSubview:prgView];
statusLabel = [[UILabel alloc] init];
statusLabel.backgroundColor = [UIColor clearColor];
statusLabel.textColor = [UIColor whiteColor];
statusLabel.font = [UIFont fontWithName:@"AmericanTypewriter-Condensed" size:18.0];
statusLabel.frame = CGRectMake(120, 80, 80, 20);
[alert addSubview:statusLabel];
[alert show];
【问题讨论】:
-
iOS7 不允许在
UIAlertView或UIActonSheet中添加任何子视图,你应该另想办法。 -
哦..好的..谢谢holex..你知道这背后的原因吗?
-
我认为这与用户隐私有关,因为许多应用程序都做到了:在没有用户明确意愿的情况下,他们自动选择了这个或那个选项(不仅在 UIAlertView 中),这并不是真的公平的行为在 IAP 的情况下;所以我猜他们喜欢限制对系统相关控件的访问,这将是程序的开始。
-
@RockandRoll 你有没有找到解决这个问题的方法?
标签: ios ios7 uiprogressview