简体   繁体   中英

iPhone 6s Plus has Compact horizontal size class in landscape orientation

I have an iPhone 6s Plus, and I have an app that supports both Portrait and Landscape orientations.

When I rotate my device and read the property mainViewController.traitCollection.horizontalSizeClass - it always equals UIUserInterfaceSizeClassCompact .

Many sources like this: https://forums.developer.apple.com/thread/17085
or this: http://useyourloaf.com/blog/size-classes/
tell that all 5.5-inch iPhones have Regular horizontal size class in the landscape orientation, but my device doesn't!!!

Launching the same app on the iPhone 6 Plus Simulator or the iPhone 6s Plus Simulator gives different results: in this case horizontal size class is Regular in landscape, like it was expected.

I wonder, what could it be? Any guesses?

iPhone 6 and 6 plus devices have a "Zoomed" display mode which makes the logical screen size appear smaller, under settings -> Display and Brightness -> Display Zoom

This affects the trait collection of a 6 plus sized device when in landscape mode. It's also a reason you shouldn't do device checking code when calculating sizes etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM