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

  • SEARCH
  • Home
  • 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 8082387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:04:38+00:00 2026-06-05T17:04:38+00:00

I have added a navigation controller inside a viewcontroller thats inside another navigation controller…

  • 0

I have added a navigation controller inside a viewcontroller thats inside another navigation controller… lol

well anyway because of this structure I have an issue with any views I push to the “sub”navigation controller.. because its only fitting inside the grame of the “parent” navigation controller its pushing the pushed views contents down by about 20/40pxl…

I was wondering how I get stop this from happening.. here are two pictures showing you what is happening.

enter image description here

where the label is clearly centered in Interface builder

enter image description here

This is the code I have so far for this stuff.

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    // Init the (sub)navigationController
    otherNav = [[UINavigationController alloc] init];
    // Add this (sub)NavController to the current viewcontroller (which is inside the (parent)navcontroller)
    [self.view addSubview:otherNav.view];
    // Hide the (sub)NavControllerbar
    otherNav.navigationBar.hidden = YES;

    // Load a detial view into the (sub)NavController
    DetailViewController *detailView = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:[NSBundle mainBundle]];
    [otherNav pushViewController:detailView animated:NO];
}

The otherNav is also set up in the .h file for global access in this view.

  • 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-06-05T17:04:40+00:00Added an answer on June 5, 2026 at 5:04 pm

    When the “super” NavigationBar is visible, the self.view.frame.height is:

    • 480-20-44 (actualViewheight-statusbarheight-navigationBarheight).

    There are 2 solutions for your problem.

    1. For simplicity I would say, if your only problem is to make it centralized.

        [self.view addSubview:otherNav.view];
        [otherNav.view setCenter:self.view.center];
    

    This will make your label center alligned.

    2.Though, if you are using interface builder;

    1. select the xib file.
    2. select the view.
    3. open Utilities.
    4. set the Top bar as Navigation bar.

    then the things you will align you will get as it is on device/simulator or what ever you are testing on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have added navigation controller into my appication in didFinishLaunchingWithOptions like this LoginViewController *mainView
In my App I have an UIViewController, that pushed by another ViewController's navigation controller.
I have a view controller that's been added to a UITabBarController . In this
I want to have a TabBar controller inside a navigation controller. So that when
I have added a navigation controller in iphone app from my home screen it
I have a navigation controller based app, and added some toolbar items with code
I have a Navigation Controller with two Views. The First View is a ViewController
I have a tableview with a navigation bar at the top. I've added text
I have added an extra field Specification in Catalog->Product->Data tab. This text is stored
I have a navigation view controller which navigates between some tableviews and I've just

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.