问题描述
我正在使用Swift创建一个Universal应用程序。我使用了Storyboard和Auto-Layouts。要求是创建一个通用的应用程序,它只支持iPhone的纵向方向和iPad的横向方向。
我已经为iPhone开发了UI,现在我将启动iPad UI。
此外,为iPhone创建的UI与为iPad创建的UI不同,两个UI都截然不同。
转到info.plist文件并添加一个带有键的数组支持的界面方向(iPhone)并在其中添加以下值:
- 人像(底部主页按钮)
同样,添加另一个数组支持的界面方向(iPad)并添加以下内容:
- 人像(底部主页按钮)
- 风景(左主页按钮)
- 风景(右主页按钮)
见下文:
I'm creating a Universal application using Swift. I have used Storyboard and Auto-Layouts. Requirement is of creating a universal application which will support Portrait orientation only for iPhone and Landscape orientation only for iPad.
I have developed UI for iPhone and now I will be starting iPad UI.
Also UI created for iPhone is not same as UI created for iPad, both UI's are quite different.
I'm thinking of to create separate storyboards for iPhone and iPad. Is there any proper way to achieve this?
Go to the info.plist file and add an array with key "Supported interface orientations (iPhone)" and add the following values in it:
- Portrait (bottom home button)
Similarly, add another array "Supported interface orientations (iPad)" and add the following:
- Portrait (bottom home button)
- Landscape (left home button)
- Landscape (right home button)
See below:
这篇关于适用于iPhone的纵向打印和iPad横向打印的通用应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!