【问题标题】:iPad landscape modal view incorrectly sizediPad 横向模式视图大小不正确
【发布时间】:2010-08-27 20:01:44
【问题描述】:

我有一个 iphone 应用程序,我想仅在横向模式下以模态方式呈现其中一个视图,并将代码设置在其视图控制器下方。在 iphone(其预期平台)上一切正常,但在 iPad 上运行进行演示时,横向视图的左侧边缘被截断约 10 像素。即看起来显示器对于屏幕来说太宽了。没有其他视图受到影响,并且在 1x 或 2x 缩放时也会发生同样的事情。

这是一个错误还是我错过了什么?

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

【问题讨论】:

    标签: iphone cocoa-touch ipad uiinterfaceorientation


    【解决方案1】:

    InterfaceOrientation 可以返回“未知”值,在这些情况下你会遇到 iPad 认为它被旋转并且你的代码会返回错误结果的情况

    【讨论】:

    • 感谢您的回复。我还没有实现任何改变方向的代码。我所有的视图都设置为 AutoSize,我只是依靠框架来进行旋转。
    • 在您编写的代码中,您引用了“interfaceOrientation == UIInterfaceOrientationLandscapeRight”,但是在横向模式下 interfaceOrientation 可能是未知的
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-25
    • 2011-09-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多