将应用程序升级到 iOS 7 - 错误“6.0 之前的 iOS 版本上的自动布局”(但希望 iOS 7 不旧)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18735847/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Upgraded app to iOS 7 - error "Auto Layout on iOS Versions prior to 6.0" (but want iOS 7 not older)
提问by metsburg
I have an iOS app that worked well on all devices in iOS 6.
我有一个 iOS 应用程序,它在 iOS 6 的所有设备上运行良好。
I recently upgraded my xcode to version 5.0 and tried to build the same app for iOS 7 on an iPhone 5.
我最近将我的 xcode 升级到 5.0 版,并尝试在 iPhone 5 上为 iOS 7 构建相同的应用程序。
On building the app, the xCode upgraded something in the code settings, but failed to build with errors.
在构建应用程序时,xCode 升级了代码设置中的某些内容,但由于错误而无法构建。
On the iPad XIB, I get an error : "Illegal Configuration : Auto Layout on iOS Versions prior to 6.0".
在 iPad XIB 上,我收到错误消息:“非法配置:6.0 之前的 iOS 版本上的自动布局”。
I tried enabling and disabling the "Use Autolayout" checkbox in the File Inspector, but it didn't work.
我尝试启用和禁用文件检查器中的“使用自动布局”复选框,但没有用。
Please help me fixing this issue.
请帮我解决这个问题。
回答by David R?nnqvist
Your problem is that the "Deployment Target" for your project is "5.0" and you are using a feature that isn't available for iOS 5.
您的问题是您项目的“部署目标”是“5.0”,并且您使用的功能不适用于 iOS 5。
Check the "General" tab for your build target
检查构建目标的“常规”选项卡
and update it to at least 6.0 to use Auto Layout
并将其更新到至少 6.0 以使用自动布局
回答by Christine
In your .xib file in Xcode 5, click on the offending control. Go to the properties menu on the right and click on the "File Inspector" tab. It is the tab that looks like a sheet of paper. On that tab, there is a section called "Interface Builder Document". Make sure "Builds for" property is set for "iOS 6.0 and Later". If none of the other fixes above have worked, this is likely your culprit.
在 Xcode 5 中的 .xib 文件中,单击有问题的控件。转到右侧的属性菜单,然后单击“文件检查器”选项卡。它是看起来像一张纸的标签。在该选项卡上,有一个名为“Interface Builder Document”的部分。确保为“iOS 6.0 及更高版本”设置了“Builds for”属性。如果上述其他修复均无效,则这可能是您的罪魁祸首。
回答by Anton Sivov
There is very simple fix. You have just to uncheck "Use Auto Layout" in General tab. More information http://shreekantpawar.com/2012/12/20/simple-solution-to-auto-layout-on-ios-versions-prior-to-6-0-error-in-mac-osx-10-7-and-later/
有非常简单的修复。您只需取消选中“常规”选项卡中的“使用自动布局”。更多信息http://shreekantpawar.com/2012/12/20/simple-solution-to-auto-layout-on-ios-versions-prior-to-6-0-error-in-mac-osx-10- 7 及以后/
回答by JRG-Developer
Assuming you are actually targeting only iOS 6.0+, it sounds like an issue related to upgrading Xcode. Sometimes, things can go awry when transitioning to a newer Xcode version.
假设您实际上只针对 iOS 6.0+,这听起来像是与升级 Xcode 相关的问题。有时,在转换到较新的 Xcode 版本时,事情可能会出错。
Here are some general tips you can try:
以下是一些您可以尝试的一般提示:
- Clean the project (press Cmd + Shift + K)
- Reset the simulator (iOS Simulator menu item -> "Reset Content and Settings")
- Restart Xcode
- Try building again, hopefully you can now
- 清理项目(按 Cmd + Shift + K)
- 重置模拟器(iOS Simulator 菜单项 ->“重置内容和设置”)
- 重启Xcode
- 再次尝试构建,希望你现在可以
回答by Gaurav Borole
Autolayout is a feature of iOS6.0 and later, If you need to support iOS 5, don't use auto layout.
Autolayout是iOS6.0及以后的功能,如果你需要支持iOS 5,不要使用自动布局。
Please go through above doc, and check "What's new in iOS6.0" and serach for "Auto layout"
请通过上面的文档,并检查“iOS6.0 中的新功能”并搜索“自动布局”
回答by Rahul K Rajan
The problem may be because of target version in of your project,it may be 5.0 i guess.There is a solution for this problem
问题可能是因为你的项目中的目标版本,我猜可能是 5.0。这个问题有一个解决方案
step1.Select your project
step1.选择你的项目
step2.select the General tab
step2.选择常规选项卡
step3.change the project deployment target.
step3.更改项目部署目标。
回答by Rio Bautista
I encountered the same problem and checked if any of the deployment target settings are set below IOS 6.0.
我遇到了同样的问题,并检查了是否有任何部署目标设置设置在 IOS 6.0 以下。
All the above mentioned settings were in order showing IOS 7.0 for all of them. So I looked deeper under the settings tab where I found that I have a sub-entry under release that says "Any Architecture" set to 5.5.1. I changed this to IOS 7.0 and that did the job for me.
上面提到的所有设置都是为了显示所有的 IOS 7.0。所以我在设置选项卡下更深入地查看,在那里我发现我有一个发布下的子条目,上面写着“任何架构”设置为 5.5.1。我将其更改为 IOS 7.0,这为我完成了这项工作。
Just writing it down here in case I need to look for it again in the future.
把它写在这里,以防我将来需要再次寻找它。