简体   繁体   English

故事板中的横向和纵向方向

[英]Landscape and portrait orientation in storyboard

I want to use two app orientation: portrait and landscape. 我想使用两种应用程序方向:纵向和横向。 I use storyboard and want set all elements there, without many code. 我使用情节提要,并希望在其中设置所有元素,而无需编写许多代码。 For example, can i use two storyboard: one for portrait, second for landscape? 例如,我可以使用两个情节提要板:一个用于肖像,第二个用于风景吗? If yes, how i could change them when device rotate? 如果是的话,设备旋转时如何更改它们?

Instead of using two storyboards for portrait and landscape you can just set the device orientation in deployment info under project navigator. 无需在纵向和横向上使用两个故事板,您只需在项目导航器下的部署信息中设置设备方向即可。 With auto layout enabled it becomes more easy to develop apps for both screen orientations. 启用自动布局后,针对两种屏幕方向开发应用程序都变得更加容易。 Take a look at the picture below to set the device orientation 看看下面的图片来设置设备方向 在此处输入图片说明

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

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