简体   繁体   English

应用程序未在ios 5中运行

[英]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. 答案将不胜感激。

If you want to run your app in iOS 5 then you have to turn off the Autolayout feature . 如果您想在iOS 5中运行您的应用程序,则必须关闭Autolayout功能 You can do that from Interface builder. 您可以从“界面”构建器执行此操作

For more help you can refer this . 如需更多帮助,请参阅此处

  1. You Need to unCheck the Auto Layout. 您需要取消选中自动布局。

在此输入图像描述

  1. And make sure you are changing here also.. select ios 5.1 并确保你也在这里改变..选择ios 5.1

在此输入图像描述

在此输入图像描述 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.

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