我正在使用Xcode 4.5开发新应用程序,并将部署目标用于iOS 4.3。应用程序应该支持iPhone 5 & iPhone 4.我谷歌设计的iPhone 5 & iPhone 4,看到以下网址。用于iPhone 5设计的自动调整掩码?
iOS 6 apps - how to deal with iPhone 5 screen size?
我们可以使用autoresizingmask为iPhone 5 & iPhone 4的设计。我做了iPhone 5的一些屏幕设计。iPhone 4 & iPhone 4。但是,我有一个疑问。 autoresizingmask是否也将用于iPhone5?我只用过iPhone 4。需要验证以下代码。请为我提供帮助。
if ([[UIScreen mainScreen] bounds].size.height < 568) {
topView.autoresizingMask = UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleBottomMargin |
UIViewAutoresizingFlexibleLeftMargin |
UIViewAutoresizingFlexibleRightMargin |
UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight ;
}
上面的代码是正确的?或者自动调整应该使用iPhone 5吗?
Ronnqvist嗨,我没有问题autoresizingmask。我的问题是,当设计iPhone 5和iPhone 4支持的应用程序时,自动调整屏蔽将用于iPhone 5? – user1756388
它可以使用。由于iOS 6(iPhone 5运行的最早版本),您可以使用新的Autolayout来配置视图的位置和大小,但如果您需要与iOS5兼容,仍然可以使用自动识别标记。 –