Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5841117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:50:51+00:00 2026-05-22T11:50:51+00:00

I created a navigation controller based app. The view that opens up below the

  • 0

I created a navigation controller based app. The view that opens up below the nvigation bar has a UIImageView and a bunch of ‘detail disclosure’ buttons on top of te uiimage for navigation purposes as well.

What I am noticing is that these buttons s have deviated down from their designer (interface builder) position when they come up in the simulator.

I suspect the navigation bar has something to do with it, but they don’t move down proportional to the height of the navigation bar.

I am not sure how to tell them to hold on to their position.

The UIImage does not overflow the height of the screen even with the navigaion bar at the top.

Are their any guidelines/gotchas one needs to know about when using navigation bar at the top?

I am using xcode 4

Thanks

Edit:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    StartScreenViewController *controller = 
    [[StartScreenViewController alloc] initWithNibName:@"StartScreenViewController" bundle:nil];
    _navigationController = [[UINavigationController alloc] initWithRootViewController:controller];

    _navigationController.view.frame = CGRectMake(0,0, 320, 460);
    _navigationController.title = @"Test";
    //[self.window addSubview:_navigationController.view];

    self.window.rootViewController = self.navigationController;
    [self.window makeKeyAndVisible];
    return YES;
}

Another thing is that if I use the ‘addsubview’ method then the nav bar is truncated while if I assign the nav controller to window.rootviewcontroller then I see the whole nav bar.

Edit 2

Here how my AppDelegate.h looks

@interface TestAppDelegate : NSObject <UIApplicationDelegate> {

    IBOutlet UIView *mainView;
}

@property (nonatomic, retain) IBOutlet UIView *mainView;

@property (nonatomic, retain) IBOutlet UIWindow *window;

//@property (nonatomic, retain) IBOutlet UIViewController *viewController;

@end

Here is the AppDelegate.m’s didFinishLaunchingWithOptions method

StartScreenViewController *controller = [[StartScreenViewController alloc] initWithNibName:@"StartScreenViewController" bundle:nil];
    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:controller];
    navController.title = @"Test";
    navController.view.frame = CGRectMake(0, 0, 320, 460);
    [self.mainView addSubview:navController.view];    
    [self.window makeKeyAndVisible];

The MainWindow.xib contains App delegate and the window as the objects. the Window has a UIView underneath it.

StartScreenViewcontroller’s xib file has the UIImageview and the buttons.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T11:50:52+00:00Added an answer on May 22, 2026 at 11:50 am

    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.

    UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
                    navController.view.frame = CGRectMake(0, 0, 320, 460);
    [self.window addSubview:navController.view];
    

    If that doesn’t work then try this search: https://stackoverflow.com/search?q=%5Biphone%5D+20px.

    EDIT:
    I missed a piece here. In order to get around this I had to add a UIView to the MainWindow.xib file….

    1. In your AppDelegate.h, create a property for IBOutlet UIView *mainView
    2. Do the @property thing for it and synthesize it in the .m file
    3. Open MainWindow.xib
    4. Drag a UIView onto the Window (NOT the ViewController) and make it fit the full frame
    5. Right click the AppDelegate object in the Documents window in IB and connect the mainView property to the UIView you just added.
    6. Now in AppDelegate.m…

    - (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;
    }
    

    and AppDelegate.h:

    @interface TestNavigationAppAppDelegate : NSObject <UIApplicationDelegate> {
        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;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a navigation based app, and I chose it so that I
I would like to create an utility application that has a navigation based flipside,
I've been working on an iPad application that has about 15 view controllers. Some
Im writing an app that I would like to display different views based on
So I have an app. On the mainWindow I have 1 button. When that
I have a controller that makes HTTP GET requests using a custom class, which
is there an easy way to change the background color of the navigation item
I want to display some data on table, let's call it TabeView app. So
my project first used the Three20 frame work for handling navigation.But due to some
@ first I thought it wasn't firing, but saw this So I waited and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.