简体   繁体   English

更改Interface Builder故事板的方向

[英]Changing the orientation of an Interface Builder Storyboard

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. 我有一个.storyboard文件,其方向我需要从纵向更改为横向,以便它不会只是拉伸场景,因为应用程序只是横向。
How can I modify this? 我怎么修改这个?

单击ViewController栏(底部,在视图下),然后转到Attribute Inspector,在Simulated Metrics> Orientation中选择Landscape。

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"/> 

by 通过

<simulatedOrientationMetrics key="orientation" orientation="landscapeRight"/>

or 要么

<simulatedOrientationMetrics key="orientation" orientation="landscapeLeft"/>

or other depending of what you need 或其他取决于您的需要

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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