我正在iphone和ipad上部署一个应用程序(iOS7和iOS8)。
我使用的故事板与大小类,基本上我有一个基本的大小类-任何适合iPad布局和紧凑-规则适合所有的iphone型号。
iPad版本中的一些视图控制器提供了自定义的幻灯片,另一些则带有弹出式。
虽然它在iOS7 ipad上运行得很好(因为xcode在iOS8上构建了不同的故事板),但我遇到的问题是,在iOS8上显示的内容选择了iphone界面。
我以通常的方式呈现出来:
if (UIPopoverPresentationController.self) {
commentVC.modalPresentationStyle = UIModalPresentationPopover;
UIPopoverPresentationController * presentationController = commentVC.popoverPresentationController;
presentationController.sourceRect = [[(AFPostTimelineTableViewCell*)cell commentButton] frame];
presentationController.sourceView = cell;
presentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
presentationController.delegate = weakSelf;
weakSelf.myPop = presentationController;
[weakSelf presentViewController:commentVC animated:YES completion:NULL];
}检查我看到的代码,显示视图控制器的UITraitCollection为C。
有没有办法让它选择R-R?
这里还有一个小示例
发布于 2015-08-05 18:12:29
找到了解决方案,UIPresentationController中有属性可以设置在呈现的-overrideTraitCollection上使用的UITraitCollection
presentationController.overrideTraitCollection= combinedTraits.copy;https://stackoverflow.com/questions/31829232
复制相似问题