我使用了UIAlertController的操作单,请看图片1号是旧的项目,2号是新的,我已经创建了新的。为什么工作表高度相差太大?
这是我正在使用的两个应用程序的代码。这是怎么回事?两个部署目标都是相同的。旧项目在Xcode 5.1.1中开发,新项目在Xcode 6.3中开发。
NSArray *array = @[@"Ari",@"Gow",@"Pra"];
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:UIAlertControllerStyleActionSheet];
for (int j = 0; j < [array count]; j++) {
UIAlertAction *defaultAction = [UIAlertAction actionWithTitle:[array objectAtIndex:j] style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) {
}];
[alertController addAction:defaultAction];
}
UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {
}];
[alertController addAction:cancelAction];
[alertController setModalPresentationStyle:UIModalPresentationPopover];
UIPopoverPresentationController *popPresenter = [alertController popoverPresentationController];
popPresenter.sourceView = self.view;
popPresenter.sourceRect = [self.view frame];
dispatch_async(dispatch_get_main_queue(), ^ {
[self presentViewController:alertController animated:YES completion:nil];
});

发布于 2015-09-11 07:50:49
这只是UIAlertController的明显高度。这是因为您正在iPhone 6模拟器中运行该项目,但是您的旧项目不支持iPhone 6屏幕大小的UI。在XCode 6.3中,iPhone 6屏幕大小是受支持的,因此它的高度更小(明显).
https://stackoverflow.com/questions/32517650
复制相似问题