Shree Krishna
Shree Krishna

Reputation: 8562

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 in portrait

  2. Iphone 4, 5 and 6 in landscape orientation have compact height and compact width. iphones in landscape orientation

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

Iphone 6 plush in landscape

My Confusion is :

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.

Upvotes: 30

Views: 4291

Answers (1)

Crazyrems
Crazyrems

Reputation: 2601

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+.

Size class illustration

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).

Upvotes: 3

Related Questions