xcode 更改 Interface Builder Storyboard 的方向
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12126456/
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
Changing the orientation of an Interface Builder Storyboard
提问by Peter V
I have a .storyboard file whose orientation I need to change from portrait to landscape so that it wouldn't just stretch the scene as the app is landscape only.
How can I modify this?
我有一个 .storyboard 文件,我需要将其方向从纵向更改为横向,这样它就不会因为应用程序仅为横向而只是拉伸场景。
我该如何修改?
回答by boscarol
Click on the ViewController bar (bottom, under the view), then go to Attribute Inspector, and in Simulated Metrics > Orientation select Landscape.
单击 ViewController 栏(底部,视图下方),然后转到 Attribute Inspector,并在 Simulated Metrics > Orientation 中选择 Landscape。
回答by Beninho85
If you have a lot of views to change :
如果你有很多观点要改变:
Right click on the storyboard -> open as source code and replace this line :
<simulatedOrientationMetrics key="orientation"/>
右键单击情节提要 -> 作为源代码打开并替换此行:
<simulatedOrientationMetrics key="orientation"/>
by
经过
<simulatedOrientationMetrics key="orientation" orientation="landscapeRight"/>
or
或者
<simulatedOrientationMetrics key="orientation" orientation="landscapeLeft"/>
or other depending of what you need
或其他取决于您的需要