问题
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