1

根据像thisthis这样的参考资料,我认为横向的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

4

1 回答 1

1

您是否为设备打开了显示缩放?

https://help.apple.com/iphone/11/#/iphd6804774e

在“标准”模式下,横向的水平尺寸等级将为常规。在“缩放”模式下,它将是紧凑的。

于 2017-12-04T18:41:29.370 回答