简体   繁体   English

Xcode 6中不同设备的不同故事板

[英]Different storyboards for different devices in Xcode 6

In the new Xcode 6, we have just one storyboard for universal apps. 在新的Xcode 6中,我们只有一个适用于通用应用的故事板。 But the differences in my app are beyond the different sizes of the screen between iPhone and iPad. 但我的应用程序的差异超出了iPhone和iPad之间屏幕的不同大小。 My App iPhone screen does not rotate, it's just portrait, and my iPad screen rotate all. 我的应用程序iPhone屏幕不旋转,它只是肖像,我的iPad屏幕全部旋转。 My iPhone first screen is a table view, and my iPad first screen is a collection view, and other differences. 我的iPhone第一个屏幕是一个表视图,而我的iPad第一个屏幕是一个集合视图,和其他差异。 How can I make it happen in Xcode 6? 我怎样才能在Xcode 6中实现它?

In other words. 换一种说法。 At Xcode 5 even using universal apps, i have two storyboards, one for iPad and another for iPhone. 在Xcode 5甚至使用通用应用程序,我有两个故事板,一个用于iPad,另一个用于iPhone。 But now, in Xcode 6, theres just one storyboard for universal apps. 但现在,在Xcode 6中,通用应用程序只有一个故事板。 I want to have two storyboards again, but I didn't find how to do this. 我想再次有两个故事板,但我没有找到如何做到这一点。

  1. Open your Project setting >> select info 打开项目设置>>选择信息
  2. In Custom iOS Target Properties add New row name Main storyboard file base name (iPad) and set value to "your new storyboard file name" 在自定义iOS目标属性中添加新行名称主故事板文件基本名称(iPad)并将值设置为“您的新故事板文件名称”

or You can find the way in my blog 或者你可以在我的博客中找到方法

Xcode 6 Separate storyboard for iPad and iPhone Xcode 6适用于iPad和iPhone的独立故事板

At Xcode 5 even using universal apps, i have two storyboards, one for iPad and another for iPhone. 在Xcode 5甚至使用通用应用程序,我有两个故事板,一个用于iPad,另一个用于iPhone。 But now, in Xcode 6, theres just one storyboard for universal apps. 但现在,在Xcode 6中,通用应用程序只有一个故事板。 I want to have two storyboards again, but I didn't find how to do this. 我想再次有两个故事板,但我没有找到如何做到这一点。

Do it the same way you were doing it in Xcode 5. No law says you have to have just one storyboard in a universal app in Xcode 6. The old way works just fine. 这样做就像你在Xcode 5中那样做。没有法律规定你必须在Xcode 6中的通用应用程序中只有一个故事板。旧方法可以正常工作。 I have apps that still do this (recompiled in Xcode 6 for iOS 8); 我有应用仍然这样做(在iOS 8的Xcode 6中重新编译); it works. 有用。

However, something odd is undoubtedly going on. 然而,奇怪的事情无疑正在发生。 Look at this screen shot. 看看这个屏幕截图。 It shows two projects open simultaneously in Xcode 6. One shows the iPhone / iPad buttons for switching between settings within the Universal setting; 它显示了在Xcode 6中同时打开的两个项目。一个显示了用于在Universal设置中切换设置的iPhone / iPad按钮; the other doesn't. 另一个没有。 I can't find a difference between the two projects that causes this differing interface. 我找不到导致这个不同界面的两个项目之间的区别。

在此输入图像描述

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

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