ios - Retina 3.5 在模态视图中旋转到 UIInterfaceOrientationLandscapeLeft 后原点错误

标签 ios objective-c rotation modalviewcontroller retina-display

我的 View 表示有一个奇怪的行为。

我的结构:

Window -> MyTabbarController -> GraphViewController -> (modal) SelectItemViewController;

窗口设置:

enter image description here

在我将我的应用更新为Retina 4 分辨率之后(并将 Window.xib 中的 UIWindow 大小设置为 Retina 4 全屏) ,myTabbarControlleroriginRetina 3.5 设备 中设置为 0,88(在 retina 4 中没有问题)。

enter image description here

如果我使用非模态 Controller ,我可以轮换到最后一天,一切正常。

但是如果我在 UIInterfaceOrientationLandscapeLeft 中调用模态视图(对于 UIInterfaceOrientationLandscapeRight 一切正常)或者关闭 modalView 在相同的状态下,GraphViewController (MyTabbarController) 的 parentView 得到一个错误的框架...

调用模态视图: enter image description here

关闭模态视图 enter image description here

我很感激每一个帮助。

ps:将 UIWindow 大小设置为 Retina 3.5 fullscreenfreeform 会使它在 iPhone 5 中看起来不对.还设置 modalPresentationStyle 不做任何事情:/

最佳答案

通过在代码中设置窗口大小解决了问题:

- (void)applicationDidFinishLaunching:(UIApplication *)application 
{
    window.frame = [UIScreen mainScreen].bounds;
    window.rootViewController = tabBarController;
    ...

设置后,框架始终设置在正确的位置。

我认为这只是 View 绑定(bind)到窗口的问题,以及它在这个“容器”中的方向(屏幕的“宽度”为 480 但框架为 568 横向模式下的像素。灰色部分就是模态视图右侧(非边界)的差异(88 像素)

关于ios - Retina 3.5 在模态视图中旋转到 UIInterfaceOrientationLandscapeLeft 后原点错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17021480/

相关文章:

iphone - 在设备锁定时播放 iPod 库中的音频

ios - 如何去除iOS中mapbox的蓝色和灰色注释

iphone - 更新到 lion 和 xCode 后内存集崩溃

jquery - 位置旋转的div

javascript - Jquery 旋转在点击时旋转图像

ios - MapView 注释中的较长字幕(swift)

ios - 以编程方式获取嵌入 UIStackView 中的自定义 UIView

iphone - 显示模态视图 Controller 时设备旋转

android - 使用 map_view (flutter) 处理后退按钮

ios - 模态关闭后 viewWillAppear 没有更新旋转