简体   繁体   中英

How set orientation in Xcode7 for a specific storyboard?

Hi I am new to Xcode7 and swift2. I came from android dev background and in android when you declare an activity in the manifest file you can set its orientation limits for each activity (Portrait, Landscape). What is Xcode7 easiest way of setting orientation restrictions for each storyboard UIview/scene?

You can set orientation in two way.

One is, you can set orientation from Attribute inspector

在此处输入图片说明

And Second is, You can set it from .plist file.

Add below key in plist file:-

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
</array>

Alternate of .plist

.plist文件的替代

Hope this will help you.

Thank you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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