支持iPhone4和iPhone5屏幕分辨率的最佳方法是什么? - 仅在iOS6中自动布局 [英] What is the best way for supporting both screen resolution of iPhone4 and iPhone5 ? - Auto layout in only iOS6

查看:130
本文介绍了支持iPhone4和iPhone5屏幕分辨率的最佳方法是什么? - 仅在iOS6中自动布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人想出如何支持iPhone4和iPhone 5的屏幕分辨率?



在iOS6中,我们支持Autolayout。可以用于iPhone4-iPhone5屏幕,即320x480和320x568。



如果我们使用自动布局功能,我们必须将部署目标保持在iOS6的最低限度。 iOS5比什么呢?



iOS5比什么?我们是否必须以不同的屏幕尺寸以编程方式处理它?<​​/ p>

我搜索了网页但找不到确切的答案所以尽管发布此问题怀疑是否有投票。请为此承担责任。我想这个问题对于在应用程序中支持新设备非常基础,适用于所有开发人员。

解决方案

如果你想支持iOS 4.3或5,请关闭Autolayout。然后你必须设置 code> UIViewAutoresizing



使用 autoresizingMask UIView 您可以将视图放在一边,并以超视图的大小增长。


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

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

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

What about iOS5 than ? 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.

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

这篇关于支持iPhone4和iPhone5屏幕分辨率的最佳方法是什么? - 仅在iOS6中自动布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆