Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 :

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

like image 269
Shree Krishna Avatar asked Jan 25 '16 06:01

Shree Krishna


People also ask

What is iPhone landscape format?

With the iPhone 6 Plus, 6s Plus, and 7s Plus, you have the ability to use the home screen in landscape mode (with the iPhone held horizontally) or in portrait mode (the iPhone held vertically).

What is compact and regular in IOS?

The Compact Size Class refers to a constrained space. It is denoted in Xcode as wC (Compact width) and hC (Compact height). The Regular Size Class refers to a non-constrained space. It is denoted in Xcode as wR (Regular width) and hR (Regular height).

What is the purpose of size classes?

Size classes are traits assigned to user interface elements, like scenes or views. They provide a rough indication of the element's size. Interface Builder lets you customize many of your layout's features based on the current size class. The layout then automatically adapts as the size class changes.


1 Answers

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

like image 152
Crazyrems Avatar answered Sep 23 '22 14:09

Crazyrems