UITraitCollection Clarification

做~自己de王妃 提交于 2019-11-30 10:05:05
Ryan

This document (scroll to Unified Storyboards for Universal Apps) explains the size classes for both iPads and iPhones.

Note that the iPhone is a bit tricky. All iPads are Regular-x-Regular in any orientation, but an iPhone's size classes change on orientation, from Regular(h)-x-Compact(w) in Portrait, to Compact-x-Compact in Landscape.

The rumored explanation for all these changes is that Apple might be introducing more screen resolutions soon, and the current number already requires a bunch of if-then's without these size classes. To ease this transition, I'd recommend thinking about things more like responsive web design, where you define a few general layouts, then stretch things to fit nicely at any exact size within one of those layouts.

EDIT:

1) In case the link breaks, find the "Whats New in iOS" Apple Doc, go to the iOS8 section, and look for "Supporting New Screen Sizes and Scales"

2) The iPhone 6+ has a regular width in landscape mode.

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