简体   繁体   中英

Why compact width and compact height in iPhone 4,5,6 in landscape orientation

I am new in iOS development and just studying Adaptivity and Layout I am stuck with a little confusion,

As per the Documentation

iOS defines two size classes:

  1. Regular :- It is associated with expansive space
  2. Compact :- It is associated with constrained space

By other references :

  1. All iPhones (top left) in the portrait orientation have a regular height and a compact width like Iphone的肖像

  2. Iphone 4, 5 and 6 in landscape orientation have compact height and compact width. iphone在横向

  3. But in case of iPhone 6 Plus, It has compact height and a regular width in landscape orientation.

    iPhone 6毛绒风景

My Confusion is :

  • iPhone 4,5,6 have regular height and compact width in portrait mode but Why they don't have regular width and compact height in landscape orientation as it was reversed?
  • If so then why iPhone 6 plus is differ from them ? Is it because it's screen is 0.8" bigger then iPhone 6 ? Does it matters ?

Thanks in advance!, Warm welcome to editors!

I know it won't affect in development so far technically But I just want to make my mind clear of these things.

If so then why iPhone 6 plus is differ from them ? Is it because it's screen is 0.8" bigger then iPhone 6 ? Does it matters ?

It matters when you are using a split view controller . When it has the same collapsed aspect on iPhone 5 and 6, it will split and show master and detail view controllers side by side in landscape orientation on iPhone 6+.

尺寸等级图

It looks even more useless on iPad, since it has regular height and width size class on both portrait and landscape.

The point is, when you have regular size class, you should layout and show more content than on compact size class.

However size classes aren't related to the screen but to the view controller.

When you have your iPad with a master and a detail view controller, the master view controller has compact width/regular height, and the detail view controller has regular width/regular height.

You can still change child view controller's size classes by overriding them with

-(void)setOverrideTraitCollection:(UITraitCollection *)collection forChildViewController:(UIViewController *)childViewController

and

-(UITraitCollection *)overrideTraitCollectionForChildViewController:(UIViewController *)childViewController.

It's a key concept for iPad since you can now on iOS9 have your app running in compact width with the new multi-task feature (slide from the right of the screen) .

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