[英]App not running in ios 5
Since i want the app to run in both ios 5 as well as in ios 6 ,I am trying to run the app in ios 5 which is working perfectly in ios 6 as i have used the autolayout feature but when i use to run the app in ios 5 it crashes since autolayout feature is not available in previous versions of ios .Is there any solution to fix out my problem ? 由于我希望应用程序在ios 5以及ios 6中运行,我试图在ios 5中运行应用程序,这在ios 6中完美运行,因为我使用了自动布局功能但是当我用来运行应用程序时在ios 5中崩溃,因为自动布局功能在以前版本的ios中不可用。有什么解决方案可以解决我的问题吗? Answer will be appreciated.
答案将不胜感激。
You have to use
AutoResizing
mask for your view instead of autolayouts
since autolayouts are supported iOS 6 onwards.Check the example below 您必须为视图使用
AutoResizing
掩码而不是AutoResizing
autolayouts
因为iOS 6以后支持AutoResizing
autolayouts
。请查看下面的示例
If you are using iOS 6 or later , then u can create a separate xib for the iphone 5 called Retina 4 Full screen . 如果您使用的是iOS 6或更高版本,那么您可以为名为Retina 4 Full screen的iphone 5创建一个单独的xib。 You need to check this in your
ViewController
Size. 您需要在
ViewController
大小中检查这一点。 Also to check for for both of these xib's . 还要检查这两个xib。 That means to run either of your xib's in iphone 5 or lower versions use these conditions whether in the
AppDelegate
or wherever you need to show another ViewController
. 这意味着无论是在
AppDelegate
还是在需要显示另一个ViewController
地方,都可以在iphone 5或更低版本中运行xib中的任何一个。
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
}
else if(result.height == 568)
{
}
the above code would check for the size of your iphone's screen and accordingly adjust. 上面的代码将检查你的iPhone屏幕的大小,并相应地调整。 Hope this has cleared your issues :).
希望这已经解决了你的问题:)。
PS:- Dont forget to add your iphone 5 splash screen ie Default-568h@2x.png . PS: - 别忘了添加你的iphone 5启动画面,即Default-568h@2x.png 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.