【问题标题】:Navigation Controller in landscape with Storyboard [iPhone]带有 Storyboard 的横向导航控制器 [iPhone]
【发布时间】:2012-03-07 02:55:56
【问题描述】:

我在情节提要中使用导航控制器,但是当我将模拟器置于横向时,我的应用程序始终是纵向格式。为什么? =(

【问题讨论】:

    标签: iphone ios5 uinavigationcontroller storyboard landscape


    【解决方案1】:

    改变

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }
    

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        // Return YES for supported orientations
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    }
    

    还要确保在您的项目设置中将“支持的设备方向”设置为允许横向。

    【讨论】:

    • 不行! :( Xcode 在我只使用横向时输入此代码。
    • @GeraldoBastos 您是否在设置中启用了横向?每当设备旋转到除纵向倒置之外的任何位置时,上述内容都会触发。
    猜你喜欢
    • 2011-04-25
    • 1970-01-01
    • 1970-01-01
    • 2011-06-18
    • 2019-12-01
    • 2017-05-14
    • 1970-01-01
    • 2012-07-25
    • 2013-07-29
    相关资源
    最近更新 更多