iPad 横向模态视图尺寸不正确
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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