2个不同的故事板,用于肖像和风景



是否可以创建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"];
    }}

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

我认为上一篇文章(iPhone Storyboard:纵向和横向的不同场景)的这个答案可能会解决你的问题。它解释了如何在纵向和横向模式下使用不同的视图,但仍然使用相同的视图控制器。

最新更新