简体   繁体   English

如何更改不同大小类的 Storyboard 入口点

[英]How to change the Storyboard entry point for varying size classes

I have an iPhone application (using a Storyboard) and want to add a iPad version.我有一个 iPhone 应用程序(使用 Storyboard)并且想要添加一个 iPad 版本。 The iPad version should have a different entry point since the it has a different hierarchy and workflow. iPad 版本应该有不同的入口点,因为它有不同的层次结构和工作流程。 Is it possible to change the storyboard entry point for different size classes?是否可以更改不同尺寸类别的故事板入口点? Or would it be better to use a separate Storyboard for the iPad version in this case?或者在这种情况下为 iPad 版本使用单独的 Storyboard 会更好吗?

In your case, you can define a different xib for only the Initial ViewController and in the code, you can check the device type in the - application:didFinishLaunchingWithOptions: , you can use在您的情况下,您可以仅为 Initial ViewController 定义不同的 xib,并且在代码中,您可以在- application:didFinishLaunchingWithOptions:检查设备类型,您可以使用

[[InitialViewController alloc] initWithNibName:@"YourNibNameAccordingToScreen" bundle:nil];

After this, as you mentioned in the comments, your other screens are adaptive to different screen sizes.So, this approach would solve your problem.在此之后,正如您在评论中提到的,您的其他屏幕会适应不同的屏幕尺寸。因此,这种方法可以解决您的问题。

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

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