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

只谈情不闲聊 提交于 2020-12-15 07:03:56

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/38349232/iphone-6s-plus-has-compact-horizontal-size-class-in-landscape-orientation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!