iPad 横向模态视图尺寸不正确

发布于 2024-09-16 10:57:29 字数 397 浏览 4 评论 0原文

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

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

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

I have a iphone app where I want to present one of the views modally in landscape mode only and have set the code below its view controller. All works fine on the iphone (its intended platform), but when run on the iPad for demonstration, the left hand edge of the landscape view is truncated by approx 10 pixels. i.e. it looks like the display is too wide for the screen. No other views are affected and the same thing happens at 1x or 2x zoom.

Is this a bug or have I missed something?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

何处潇湘 2024-09-23 10:57:29

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

InterfaceOrientation can return "unknown" value, in these cases you can encounter the case that the iPad thinks it is rotated and your code will return the wrong result

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文