【问题标题】:Portrait FormSheet Rotation IPad纵向表格表格旋转 IPad
【发布时间】:2013-05-18 00:57:31
【问题描述】:

我正在使用标签栏控制器在拆分视图上创建应用程序。我的问题是当我在肖像上并隐藏主视图时,我的表单会消失。如果显示当前的表单,有没有办法防止轮换?

【问题讨论】:

    标签: ipad rotation


    【解决方案1】:

    在您的代码中包含此方法,如果您的表单被关闭,您可能需要添加一个附加方法。这段代码会将您的视图锁定为横向。

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations.
    
    if (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
        return YES;
    } else {
        return NO;
    }
    

    }

    【讨论】:

    • 不,先生,我希望我的应用程序可以在所有方向上运行。我的问题是当我展示我想保持纵向的表单时,否则所有方向。表单的呈现控制器是一个弹出框。
    猜你喜欢
    • 2011-12-24
    • 1970-01-01
    • 1970-01-01
    • 2012-01-12
    • 2011-07-23
    • 1970-01-01
    • 2011-12-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多