UIAlertController高度差

UIAlertController height difference

我已经使用 UIAlertController 进行操作sheet,请看图片 1 号是旧项目,2 号是我新创建的新项目。为什么动作 sheet 高度相差太大?

这是我正在使用的两个应用程序的代码。这有什么问题吗?两个部署目标相同。 旧项目在 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];
});

这只是表观高度UIAlertController。之所以如此,是因为您是 运行 iPhone 6 模拟器中的项目,但您的旧项目不支持 UI iPhone 6 屏幕尺寸。在 XCode 6.3 中,支持 iPhone 6 屏幕尺寸,因此较小的(表观)高度。