简体   繁体   English

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

[英]What is the best way for supporting both screen resolution of iPhone4 and iPhone5 ? - Auto layout in only iOS6

Have anyone figured out how to support both screen resolution iPhone4 and iPhone 5 ? 有谁知道如何同时支持屏幕分辨率iPhone4和iPhone 5?

In iOS6 we have support of Autolayout. 在iOS6中,我们支持自动布局。 Can that be used for iPhone4-iPhone5 screen ie 320x480 and 320x568. 可以用于iPhone4-iPhone5屏幕,即320x480和320x568。

If we use auto layout feature for that we will have to keep deployment target minimum to iOS6. 如果我们为此使用自动布局功能,则必须将部署目标最小化为iOS6。 What about iOS5 than ? 那iOS5比呢?

What about iOS5 than ? 那iOS5比呢? Do we have to handle it programatically for different screen size ? 我们是否必须以编程方式针对不同的屏幕尺寸来处理它?

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. 我想这个问题对于在应用程序中支持新设备非常基本,并且适用于所有开发人员。

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,请关闭Autolayout,然后必须在代码或界面构建器中正确设置UIViewAutoresizing

With the autoresizingMask on UIView you can make the view stick to aside and grow with the size of the superview. 借助UIView上的autoresizingMask ,您可以将视图固定在一边,并autoresizingMask视图的大小而增长。

One other approach can be to design separate views for iPhone 5 and iPhone 4S. 另一种方法是为iPhone 5和iPhone 4S设计单独的视图。 Check screensize and load views accordingly, as in the case of universal apps. 与通用应用程序一样,检查屏幕尺寸并相应地加载视图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM