【问题标题】:2 different storyboards for portrait and landscape2个不同的纵向和横向故事板
【发布时间】:2012-03-10 15:20:30
【问题描述】:

是否可以创建 2 个故事板并根据设备方向访问每个故事板?我试过这段代码:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;

    if (UIInterfaceOrientationPortrait){
              UIStoryboard *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"Storyboardland.storyboard"];


    }else if (UIInterfaceOrientationPortraitUpsideDown){
        UIStoryboard *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"MainStoryboard_iPad.storyboard"];

    }}

...但是不起作用??我犯了什么错误??

【问题讨论】:

    标签: ios xcode storyboard uistoryboard


    【解决方案1】:

    我认为this answer to a previous post (iPhone Storyboard: different scene for portrait and landscape) 可能会解决您的问题。它解释了如何为纵向和横向模式设置不同的视图,但仍使用相同的视图控制器。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-12-14
      • 2015-02-20
      • 2014-11-15
      • 1970-01-01
      • 2012-05-02
      • 1970-01-01
      相关资源
      最近更新 更多