关于 iOS7 Universal App 的问题

  1. story board 怎么设计?因为兼容 iOS7,所以无法使用 size class
  2. 如何在所有 view controller 允许 iPad 旋转,同时不允许 iPhone 不旋转
阅读 3.7k
2 个回答

问题2的答案有了

@interface UIViewController (Rotate)
@end
@implementation UIViewController (Rotate)
- (NSUInteger)supportedInterfaceOrientations {
    if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)
        return UIInterfaceOrientationMaskAll;
    return UIInterfaceOrientationMaskPortrait;
}
@end

这个答案是兼容 iOS7 的做法。在 iOS8 and above 中,旋转这个含义已经没有意义了。

问题一可不可以主做ios7然后向后兼容ios8

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题