wants FullScreenLayout is something complex and unrelated. ALL viewcontrollers are required in order to be built into the "layout view manager" (Apples UINavigationController, Apple UITabBarController), OR fully implement the complex logic "how much should I be and where do I position?". on their own.
Apple decided with iOS 1.0 that the main view of the iPhone that you see did NOT START at 0.0. The window that contains it starts with (0,0), but it appears above the status bar.
I think this decision, which they came to regret, it made sense at the time, but in the long run it caused a lot of mistakes.
Net effect:
- UINavigationController and UITabBarController have a special (undocumented) internal code that makes it SEEM AS IF (0,0) the upper left corner - they force change / change any custom UIViewController that you add to them
- ... if you DO NOT use one of them as the main controller, you will have to re-implement this logic yourself. If you use a third-party instance of the UIViewController, the logic often runs incorrectly or is missing.
- ... you can fix it yourself at runtime by reinstalling UIViewController.view (its root view), for example. in the following way:
(code)
UIViewController* rootController = // in this case HHTabController? UIView* rootView = rootController.view; CGRect frame = rootView.frame; CGPoint oldOrigin = frame.origin; CGPoint newOrigin = // calculate this, according to Apple docs. // in your current case, it should be: CGPointMake( 0, 20 ); frame.origin = newOrigin; frame.size = CGSizeMake( frame.size.width - (newOrigin.x - oldOrigin.x), frame.size.height - (newOrigin.y - oldOrigin.y) ); rootView.frame = frame;
... obviously, it annoys having to do it every time. That's why Apple strongly recommends everyone to use the UINavigationController and / or UITabBarController :)
source share