菜鸟教程小白 发表于 2022-12-11 21:53:48

ios - 2个不同的纵向和横向 Storyboard


                                            <p><p>是否可以创建 2 个 Storyboard并根据设备方向访问每个 Storyboard?我试过这段代码:</p>

<pre><code>- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return YES;

    if (UIInterfaceOrientationPortrait){
            UIStoryboard *controller = ;


    }else if (UIInterfaceOrientationPortraitUpsideDown){
      UIStoryboard *controller = ;

    }}
</code></pre>

<p>...但是不起作用??我犯了什么错误??</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我认为 <a href="https://stackoverflow.com/questions/8777629/iphone-storyboard-different-scene-for-portrait-and-landscape/8863381#8863381" rel="noreferrer noopener nofollow">this answer to a previous post (iPhone Storyboard: different scene for portrait and landscape)</a>可能会解决您的问题。它解释了如何为纵向和横向模式设置不同的 View ,但仍使用相同的 ViewController 。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 2个不同的纵向和横向 Storyboard,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/9647548/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/9647548/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 2个不同的纵向和横向 Storyboard