首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UIAlertController高差

UIAlertController高差
EN

Stack Overflow用户
提问于 2015-09-11 07:13:48
回答 1查看 926关注 0票数 0

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

这是我正在使用的两个应用程序的代码。这是怎么回事?两个部署目标都是相同的。旧项目在Xcode 5.1.1中开发,新项目在Xcode 6.3中开发。

代码语言:javascript
复制
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];
});

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-09-11 07:50:49

这只是UIAlertController的明显高度。这是因为您正在iPhone 6模拟器中运行该项目,但是您的旧项目不支持iPhone 6屏幕大小的UI。在XCode 6.3中,iPhone 6屏幕大小是受支持的,因此它的高度更小(明显).

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32517650

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档