根据像this或this这样的参考资料,我认为横向的iPhone 7 Plus应该有常规尺寸等级。
这是当前视图控制器中的代码,根据此参考:
- (void) traitCollectionDidChange: (UITraitCollection *) previousTraitCollection {
[super traitCollectionDidChange: previousTraitCollection];
NSLog(@"current trait collection: %@",self.traitCollection);
NSLog(@"previous trait collection: %@", previousTraitCollection);
}
这是在 iPhone 7 Plus 上从纵向到横向时控制台上的输出:
current trait collection: <UITraitCollection: 0x1c44efd00; _UITraitNameUserInterfaceIdiom = Phone, _UITraitNameDisplayScale = 3.000000, _UITraitNameDisplayGamut = P3, _UITraitNameHorizontalSizeClass = Compact, _UITraitNameVerticalSizeClass = Compact, _UITraitNameTouchLevel = 0, _UITraitNameInteractionModel = 1, _UITraitNameUserInterfaceStyle = 1, _UITraitNameUserInterfaceLayoutDirection = 0, _UITraitNameForceTouchCapability = 2, _UITraitNamePreferredContentSizeCategory = UICTContentSizeCategoryL, _UITraitNameDisplayCornerRadius = 0.000000>
previous trait collection: <UITraitCollection: 0x1c02fa900; _UITraitNameUserInterfaceIdiom = Phone, _UITraitNameDisplayScale = 3.000000, _UITraitNameDisplayGamut = P3, _UITraitNameHorizontalSizeClass = Compact, _UITraitNameVerticalSizeClass = Regular, _UITraitNameTouchLevel = 0, _UITraitNameInteractionModel = 1, _UITraitNameUserInterfaceStyle = 1, _UITraitNameUserInterfaceLayoutDirection = 0, _UITraitNameForceTouchCapability = 2, _UITraitNamePreferredContentSizeCategory = UICTContentSizeCategoryL, _UITraitNameDisplayCornerRadius = 0.000000>
水平尺寸类保持紧凑,我预计会从紧凑型变为常规型。
使用 iOS 11.1.2 和 Xcode 9.1