Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Take some screen shots and see how far they are being moved down. If its 20px then this is a problem that tons of people have had (including myself). I fixed it by redefining the view to be the same size that it is in IB. For some reason the iPhone tries to be smart and help you resize things and sometimes it does it wrong.</p> <pre><code>UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController]; navController.view.frame = CGRectMake(0, 0, 320, 460); [self.window addSubview:navController.view]; </code></pre> <p>If that doesn't work then try this search: <a href="https://stackoverflow.com/search?q=%5Biphone%5D%2020px">https://stackoverflow.com/search?q=%5Biphone%5D+20px</a>. <br /><br /><br /> EDIT:<br /> I missed a piece here. In order to get around this I had to add a UIView to the MainWindow.xib file....<br /><br /> 1. In your AppDelegate.h, create a property for IBOutlet UIView *mainView<br /> 2. Do the @property thing for it and synthesize it in the .m file <br /> 3. Open MainWindow.xib<br /> 4. Drag a UIView onto the Window (NOT the ViewController) and make it fit the full frame<br /> 5. Right click the AppDelegate object in the Documents window in IB and connect the mainView property to the UIView you just added.<br /> 6. Now in AppDelegate.m... <br /></p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController]; navController.view.frame = CGRectMake(0, 0, 320, 460); //[self.window addSubview:navController.view]; // old broken way [mainView addSubview:navController.view]; [self.window makeKeyAndVisible]; return YES; } </code></pre> <p>and AppDelegate.h:</p> <pre><code>@interface TestNavigationAppAppDelegate : NSObject &lt;UIApplicationDelegate&gt; { UIWindow *window; TestNavigationAppViewController *viewController; IBOutlet UIView *mainView; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet TestNavigationAppViewController *viewController; @property (nonatomic, retain) IBOutlet UIView *mainView; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload