我正在研究具有所有方向支持的通用应用程序。我也跟着下面的步骤Swift 2.0中的尺寸类别无法正常工作
- 选择
width compact
&height any
尺寸级别,见下图:
至于我能理解上面的图片介绍,如果我们想设计布局iPhone- 4到iPhone-6比我们应该使用
width compact
&height any
大小类。
在使用width compact
& height any
I类放约束像下面的图像中
- 选择
width compact
&height regular
尺寸类,见下文:
这对我来说有点令人困惑,所以我所做的只是考虑
width compact
&height regular
尺寸等级仅适用于iPhone-6 Plus。
在使用width compact
& height regular
大小I类放约束相同我把用于width compact
& height any
尺寸类,但改变约束的值,请参见下面的图像
在上述图像中看看右侧的红色框,我已经为三种尺寸类别的height
和width
约束添加了多个值width compact
& height any
,width compact
& height regular
,width regular
& height regular
。
我与尺寸类问题:当我从iPhone-4上运行的模拟器或设备应用到iPhone-6中,示出了UIImageView
与height
和width
我分配给width compact
& height regular
即250,在那里它必须显示UIImageView
与height
和width
我分配到width compact
& height any
即200
虽然在iPhone上-6 Plus或iPad上它显示CORRE运行的应用程序我为他们分配的编号为
height
和width
。
查询:我怎么能实现不同尺寸不同的iPhone类似的UIImageView等控制器对象?
我没有给你,什么是_compact horizontal_和_regular vertical_?你的意思是_compact width_和_regular height_? –
@VijaySanghavi是的,这是他们如何在HIG文档中调用它们https://developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/MobileHIG/LayoutandAppearance.html – Andrea
如何实现控制器对象,如'UIImageView '在不同尺寸的不同iPhone上?正如你所说的,横向和垂直的垂直_适用于所有类型的iPhone(iPhone4到iPhone6和iPhone6 Plus)。请让我知道我能做到这一点。 –