UINavigationController have to set view height to 548 on 3.5 inch screen

三世轮回 提交于 2019-12-08 10:13:33

问题


I think a have a special case here, since I've a UIViewController with a IB view set to 4 inch size and add a UINavigationController with addChildViewController (Facebook/Path like slider menu). The Problem I'm facing now is that if I run the app the height of the UINavigationController view is 372 when setting

containerViewController.view.frame = CGRectMake(0, 0, 320, 460);

I've to set the height to 548 to get the correct height of 460 on a 3.5 inch device. How can I fix that?

I als register an event on the UIBarButtonItem to slide away the screen with

[UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
            self.navigationController.view.frame = CGRectMake(268, 0, 320, 460);
        } completion:^(BOOL finished){ }];

When clicking on the button the UIView is set to the correct height but I'm using the exact same size of (268, 0, 320, 460) for CGRectMake.

When I'm setting the frame after

[self.window makeKeyAndVisible];

it is working by using 460 for the height, why is this working, I think iOS is performing the display size adjustment only after makeKeyAndVisible

来源:https://stackoverflow.com/questions/15359769/uinavigationcontroller-have-to-set-view-height-to-548-on-3-5-inch-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!