[英]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, 我是iOS开发的新手,只是学习适应性和布局,我有些困惑,
As per the Documentation 根据文档
iOS defines two size classes: iOS定义了两个大小类:
By other references : 通过其他参考:
All iPhones (top left) in the portrait orientation have a regular height and a compact width like 所有以纵向放置的iPhone(左上角)都具有常规的高度和紧凑的宽度,例如
Iphone 4, 5 and 6 in landscape orientation have compact height and compact width. 横向放置的iPhone 4、5和6具有紧凑的高度和紧凑的宽度。
But in case of iPhone 6 Plus, It has compact height and a regular width in landscape orientation. 但是,对于iPhone 6 Plus,它的高度紧凑,横向固定宽度固定。
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. 我知道到目前为止,从技术上讲它不会影响开发,但是我只想让我头脑清楚这些事情。
If so then why iPhone 6 plus is differ from them ?
如果是这样,那么为什么iPhone 6 plus与它们不同? Is it because it's screen is 0.8" bigger then iPhone 6 ? Does it matters ?
是因为它的屏幕比iPhone 6大0.8英寸?这有关系吗?
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+.
当iPhone 5和iPhone 6具有相同的折叠外观时,它将在iPhone 6+上以横向显示并排显示主视图和局部视图控制器。
It looks even more useless on iPad, since it has regular height and width size class on both portrait and landscape. 在iPad上,它看起来毫无用处,因为它在纵向和横向上均具有常规的高度和宽度尺寸级别。
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. 当您的iPad带有主视图和局部视图控制器时,主视图控制器具有紧凑的宽度/常规高度,而局部视图控制器具有常规的宽度/常规高度。
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) . 这是iPad的关键概念,因为您现在可以在iOS9上使用新的多任务功能(从屏幕右侧滑动)以紧凑的宽度运行您的应用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.