支持iPhone4和iPhone5屏幕分辨率的最佳方式是什么?- iOS6中的自动布局

时间:2021-08-06 10:45:37

Have anyone figured out how to support both screen resolution iPhone4 and iPhone 5 ?

有没有人知道如何同时支持屏幕分辨率iPhone4和iphone5 ?

In iOS6 we have support of Autolayout. Can that be used for iPhone4-iPhone5 screen i.e. 320x480 and 320x568.

在iOS6中,我们支持自动布局。可以用于iPhone4-iPhone5屏幕320x480和320x568吗?

If we use auto layout feature for that we will have to keep deployment target minimum to iOS6. What about iOS5 than ?

如果我们使用自动布局功能,我们将不得不将部署目标保持在iOS6的最小值。iOS5比?

What about iOS5 than ? Do we have to handle it programatically for different screen size ?

那iOS5呢?我们是否需要针对不同的屏幕尺寸进行编程处理?

I searched web and could not find exact answer for that so posting this question though having doubt of having downvotes. Please bear with me for that. I guess this question is very basic to support new device in applications and is applicable to all developers.

我搜索了网页,但是没有找到确切的答案,所以在网上发布了这个问题,尽管我怀疑是否有下降票。请耐心听我说。我想这个问题对于在应用程序中支持新设备是非常基本的,适用于所有开发人员。

2 个解决方案

#1


9  

If you want to support iOS 4.3 or 5 then turn off the Autolayout.Then you have to set the UIViewAutoresizing correctly either in code or interface builder.

如果你想支持iOS 4.3或5,那么关闭自动布局。然后,您必须在代码或接口构建器中正确设置UIViewAutoresizing。

With the autoresizingMask on UIView you can make the view stick to aside and grow with the size of the superview.

使用UIView上的autoresizingMask,你可以让视图保持在一边,并随父视图的大小一起增长。

#2


2  

One other approach can be to design separate views for iPhone 5 and iPhone 4S. Check screensize and load views accordingly, as in the case of universal apps.

另一种方法是为iPhone 5和iPhone 4S设计单独的视图。检查屏幕大小和加载视图,就像在通用应用程序中一样。

#1


9  

If you want to support iOS 4.3 or 5 then turn off the Autolayout.Then you have to set the UIViewAutoresizing correctly either in code or interface builder.

如果你想支持iOS 4.3或5,那么关闭自动布局。然后,您必须在代码或接口构建器中正确设置UIViewAutoresizing。

With the autoresizingMask on UIView you can make the view stick to aside and grow with the size of the superview.

使用UIView上的autoresizingMask,你可以让视图保持在一边,并随父视图的大小一起增长。

#2


2  

One other approach can be to design separate views for iPhone 5 and iPhone 4S. Check screensize and load views accordingly, as in the case of universal apps.

另一种方法是为iPhone 5和iPhone 4S设计单独的视图。检查屏幕大小和加载视图,就像在通用应用程序中一样。