为iOS(iPhone和iPad)制作两个故事板 [英] Making two storyboards for iOS (iPhone and iPad)

查看:132
本文介绍了为iOS(iPhone和iPad)制作两个故事板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以只制作一个应用程序并在其中制作两个故事板,一个用于iPhone,另一个用于iPad?我不喜欢在iPad上运行应用程序并单击2x按钮的想法。

Is it possible to make only one application and inside of it make two storyboards, one for iPhone and one for iPad? I don't like the idea of running the app on iPad and clicking the 2x button.

我的想法是创建两个故事板并且有一个初始类可以检查是否您使用的设备是iPhone或iPad,然后重定向到相应的故事板。我认为这是一个好主意,因为代码是相同的。

My idea was to create two storyboards and have a beginning class that would check if the device you are using is an iPhone or an iPad and then redirect to the according storyboard after. I think it is a good idea cause the code is the same.

推荐答案

创建两个不同的故事板并命名它们以便它们很容易指定哪个是哪个。然后单击允许您更改实际应用程序设置的文件。并将构建更改为 universal ,然后指定要使用的故事板!

create two different storyboards and name them so they are easily specified which is which. Then click on the file that allows you to change settings for your actual app. and change the build to universal, then specify which storyboard you want to use!

有iphone和ipad的故事板设置

there is a storyboard setting for iphone and ipad

iPhone

iPad

确保故事板的名称已正确设置

Make sure the names of the storyboards are correctly set though

这篇关于为iOS(iPhone和iPad)制作两个故事板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆