问题
With the new iPhone 6 Plus, in landscape the phone can show more content than the normal iPhone 6 or its predecessors. This makes sense, as in landscape the phone identifies as having a "regular width" for its size class.
However, in portrait its' still compact width, regular height for the size class, regardless of which iPhone. How is Apple then showing more on the iPhone 6 Plus in portrait when there's no size class identifying it?
Are they hard-coding it based on the device's width? Doesn't that go against the whole philosophy of size classes?
回答1:
They are using auto layout to force their labels to adopt the width of the screen. There's a good description of how to achieve this in this SO answer.
Apple have also used Adaptive layout to implement the landscape view on Mail for the 6+.
来源:https://stackoverflow.com/questions/25769312/how-is-apple-showing-more-in-the-messages-app-in-portrait-on-the-iphone-6-plus