关于 iOS7 Universal App 的问题


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

storyboard ios ios7

啊哦呃咦呜吁 10 years, 11 months ago

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

火焰喵·燐 answered 10 years, 11 months ago

问题2的答案有了


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

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

万恶的百度 answered 10 years, 11 months ago

Your Answer