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 6154651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:17:55+00:00 2026-05-23T20:17:55+00:00

I am working on an app that has a navigation view controller in a

  • 0

I am working on an app that has a navigation view controller in a view controller. Everything works fine except for the fact that when it dosen’t start in portrait the navigation controller isn’t properly sized and takes up the whole screen. I have screenshots how what is happening.

here is what happens when application is started in portrait here

now when the application starts in either landscape right/left or portrait upside down this happen here

I don’t know if anyone has a solution for this problem since because it has a space at the top there is always a gap when the rotation occurs.

For more reference i’ve included some of my code.

-(void)viewDidLoad{
SongsViewController *viewController = [[SongsViewController alloc] initWithNibName:@"SongsViewController" bundle:nil];

dataView = [[UINavigationController alloc] initWithRootViewController:viewController];
[dataView setDelegate:self];
dataView.view.frame = CGRectMake(192, 85, 768 - 192, 1004 - 85 - 44);
[dataView.view setAutoresizesSubviews:YES];
[dataView.view setAutoresizingMask:UIViewAutoresizingNone];

[self.view addSubview:dataView.view];
[viewController release];
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation) interfaceOrientation duration:(NSTimeInterval)duration{

if (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation ==       UIInterfaceOrientationPortraitUpsideDown) {

    dataView.view.frame = CGRectMake(192, 85, 768 - 192, 1004 - 85 - 44);

}

else {

    dataView.view.frame = CGRectMake(192, 85, 1024 - 192, 748 - 85 - 44);

}

}
  • 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-23T20:17:55+00:00Added an answer on May 23, 2026 at 8:17 pm

    First off, you ideally shouldnt be adding a ViewController’s view as a subview to another viewController’s view. Atleast in iOS <= 4.3.

    What you must be doing is start your application with the ViewController’s view embedded inside a navigationController. What I mean to say is, try to make the root view controller of your application as navigationController. Or, if you have a tabBar as the base of your application, try making each tab’s viewController as navigationController.

    Next, use the viewController’s property:

    self.navigationController
    

    To further push / pop viewControllers into or from it.

    You need not do those frame adjustments in the rotation delegate methods, all you have to do is set the autoresizing masks properly for the view components (subviews of) of your SongsViewController and rest all should be taken care automatically.

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

Sidebar

Related Questions

I am working on a C++ app which internally has some controller objects that
I'm working on a view-based iPhone app that has the following flow: search ->
I'm working on an iPhone app that (among other things) has a detail view
I'm working on a rails app that has a whole bunch of before filters
I'm working on an iPhone app where I'm using a navigation controller (UINavigationController) to
I am working on an app that has several different views, two of the
I'm working on an app that grabs and installs a bunch of updates off
I'm working on an app that requires no user input, but I don't want
I'm working on an app that needs to intercept when a program tries to
I'm working on an App that talks to a serial port, and on my

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.