ios Xcode 7 Beta 警告:界面方向和启动故事板
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31141806/
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
Xcode 7 Beta warnings: Interface Orientations and Launch Storyboard
提问by bachma0507
I opened my project in Xcode 7 beta and I am getting the following warnings which I do not get in Xcode 6:
我在 Xcode 7 beta 中打开了我的项目,但收到了以下警告,而 Xcode 6 中没有:
All interface orientations must be supported unless the app requires
full screen.
A launch storyboard or xib must be provided unless the app requires
full screen.
The app uses Portrait orientation for devices only, and I have it set that way. I also have storyboards for both iphone and ipad interfaces. I can't determine why I am getting these warnings. Is this an Xcode 7 beta bug?
该应用程序仅对设备使用纵向方向,我已将其设置为这种方式。我也有 iphone 和 ipad 界面的故事板。我无法确定为什么会收到这些警告。这是 Xcode 7 测试版的错误吗?
回答by Simon Tillson
This warning is new for iOS 9 since it supports resizable apps with multi-window support. Previously, apps would be auto-scaled to new devices which had different hardware display resolutions to those in the launch image (which is basically how iOS detects the supported interface resolutions). Now, apps which support multi-window must define the resolutions they support by including a launch image or storyboard for all device screen types.
此警告是 iOS 9 的新增功能,因为它支持具有多窗口支持的可调整大小的应用程序。以前,应用程序会自动缩放到与启动图像中的硬件显示分辨率不同的新设备(这基本上是 iOS 检测支持的界面分辨率的方式)。现在,支持多窗口的应用程序必须通过包含适用于所有设备屏幕类型的启动图像或故事板来定义它们支持的分辨率。
Unless you are re-writing your app to support multi-window, you will be requiring 'Full screen'. This is a hint to iOS that you do not support multi-window, and basically makes iOS 9 work like previous versions in this regard.
除非您重新编写应用程序以支持多窗口,否则您将需要“全屏”。这是对 iOS 的提示,您不支持多窗口,并且在这方面基本上使 iOS 9 像以前的版本一样工作。
So, if you are submitting an app update for iOS 9, and you do not support multi-window, all you have to do is to go to your Project Target settings, select General, and under 'Deployment Info' look for the tick box called 'Requires Full Screen'. Tick this and the warnings will disappear.
因此,如果您要为 iOS 9 提交应用更新,并且您不支持多窗口,那么您要做的就是转到您的项目目标设置,选择常规,然后在“部署信息”下查找复选框称为“需要全屏”。勾选此项,警告将消失。
It is certainly not a bug. If this warning is present, then your app may have trouble during submission. Not sure about that, because I haven't submitted an app with iOS 9 GM Seed yet, but I'm certainly going to tick the box :-)
这当然不是一个错误。如果出现此警告,则您的应用程序在提交过程中可能会遇到问题。对此不确定,因为我还没有提交带有 iOS 9 GM Seed 的应用程序,但我肯定会勾选此框:-)
回答by YangXiaoyu
Just go to your target,click "General" tab,find the "Deployment Info" section,check the "Requires full screen". :)
只需转到您的目标,单击“常规”选项卡,找到“部署信息”部分,选中“需要全屏”。:)
It's so easy,right?
这很容易,对吧?
BTW, this is not the best solution. There will be more and more better solutions. But when I answer this question, I only thought how to kill the warnings. I didn't explain why do this but how to solve this. Xcode beta version might change it's features, so I just provide a "workaround" at that early time. So if you think my solution is a workaround, please vote up for other better answers. But this is not the reason for voting down. Thanks :)
顺便说一句,这不是最好的解决方案。将会有越来越多更好的解决方案。但是当我回答这个问题时,我只想到如何杀死警告。我没有解释为什么要这样做,而是解释如何解决这个问题。Xcode beta 版本可能会改变它的功能,所以我只是在早期提供了一个“解决方法”。因此,如果您认为我的解决方案是一种解决方法,请投票支持其他更好的答案。但这不是投票否决的原因。谢谢 :)
回答by Rohit Goyal
This is because Apple has added multi task ability in iOS 9. All you need to tell Xcode is that your app require full screen.
这是因为 Apple 在 iOS 9 中添加了多任务功能。您需要告诉 Xcode 的是您的应用程序需要全屏显示。
Add the UIRequiresFullScreen key to your Xcode project's Info.plist file and apply the Boolean value YES.
将 UIRequiresFullScreen 键添加到 Xcode 项目的 Info.plist 文件并应用布尔值 YES。
To read more about it in general.
https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/AdoptingMultitaskingOniPad/index.html
阅读更多关于它的一般信息。
https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/AdoptingMultitaskingOniPad/index.html
回答by d2burke
I just saw this error and after reading the comments, I surely want to support iPad and multi-window use. This is as simple as checking Device Orientationoptions "Landscape Left" and "Landscape Right" and making sure that my UI supports these.
我刚看到这个错误,看了评论后,我肯定想支持 iPad 和多窗口使用。这就像检查设备方向选项“Landscape Left”和“Landscape Right”并确保我的 UI 支持这些一样简单。
Best way I found to test for good multi-window support is to use the resizable simulators, or better in my opinion, use the iPad Pro in XCode 7.1 and actually activate the multi-window feature by dragging from the right. After taking these steps, I my app supports these features and I'm able to quickly see what I need to update or optimize to fully support them.
我发现测试良好的多窗口支持的最佳方法是使用可调整大小的模拟器,或者在我看来更好的是,使用 XCode 7.1 中的 iPad Pro 并通过从右侧拖动来实际激活多窗口功能。采取这些步骤后,我的应用程序支持这些功能,并且我能够快速查看需要更新或优化的内容以完全支持它们。
回答by CosmicMind
回答by Basil Bourque
“Clean Build Folder” and build again
“清理构建文件夹”并再次构建
I got the All interface orientations must be supported unless the app requires full screen.
message today in Xcode 7.3.1, seemingly for no reason, no related change that I made.
我All interface orientations must be supported unless the app requires full screen.
今天在 Xcode 7.3.1 中收到了这条消息,似乎没有任何原因,我没有做相关的更改。
- I dohave a
LaunchScreen.storyboard
- I have notchecked
Requires full screen
.
- 我做的有
LaunchScreen.storyboard
- 我没有查过
Requires full screen
。
I tried the usual maneuver when Xcode leaves me puzzled about some-new-error-for-no-good-reason:
当 Xcode 让我对一些新的错误原因感到困惑时,我尝试了通常的策略:
- Hold down Optionkey while clicking the
Product
menu. - Choose
Clean Build Folder
(notClean
). - Choose
Product
>Build
.
- 单击菜单时按住Option键
Product
。 - 选择
Clean Build Folder
(不是Clean
)。 - 选择
Product
>Build
。
No more problem. After a few more build-and-run sessions, the error message has yet to re-appear.
没有问题了。经过几次构建和运行会话后,错误消息尚未重新出现。
回答by Prasad Patil
回答by cbiggin
Have you provided a "Launch Storyboard" for your app? Or have you just provided static images for the various sizes.
您是否为您的应用提供了“启动故事板”?或者您是否刚刚提供了各种尺寸的静态图像。
在这里查看:https: //developer.apple.com/library/prerelease/ios/documentation/UserExperience/Conceptual/MobileHIG/LaunchImages.html