xcode 如何使 ipad 应用程序仅肖像?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29779330/
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
How to make an ipad app only portrait?
提问by nachshon fertel
I am making an ipad app, and i set the the app to only portrait, but it still works in landscape? Why is this happening only on an ipad? How do i fix this?
我正在制作一个 ipad 应用程序,并将该应用程序设置为仅纵向,但它仍然可以横向运行?为什么这种情况只发生在 ipad 上?我该如何解决?
Note: if the answer is in code, please write it in swift.
注意:如果答案在代码中,请用swift写。
回答by Arun Gupta
In xcode select your project. Go to Targets -> General, scroll down and you can select the Orientation as portrait only.
在 xcode 中选择您的项目。转到目标 -> 常规,向下滚动,您可以仅将方向选择为纵向。
You can also make change to info.plist file to select proper orientations for Supported interface orientations (iPad)
您还可以更改 info.plist 文件以选择支持的界面方向(iPad)的正确方向
回答by Venu Gopal Tewari
In deployment Info section you can select your app orientation to support.
在部署信息部分,您可以选择要支持的应用程序方向。