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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:24:50+00:00 2026-05-20T21:24:50+00:00

I have a simple app that has two view controllers. Both of them have

  • 0

I have a simple app that has two view controllers. Both of them have a UINavigationBar at the top, as a header. The second UIViewController is displayed as a modal view, when the user clicks on a button on the first one.

When my app first launches, the initial view doesn’t completely cover the main UIView and seems “pushed” to the top (see image below).
enter image description here

After I click on the “instructions” button, which displays another view with presentModalViewController:animated:, and dismiss the modal ViewController, everything is displayed correctly.

Anybody knows what I might be doing wrong?

I have nothing in viewWillAppear, and this is my viewDidLoad

- (void)viewDidLoad {
    [super viewDidLoad];

    if (!self.model) {
        self.model = [[FRRSushiRiceModel alloc] init];
        [[self.header.items objectAtIndex:0] setTitle:  @"Perfect Sushi Rice: Ingredients"];
    }
}

and my application:didFinishLaunchingWithOptions:

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


    // Create and add the main controller (ingredients)
    self.ingredientsController = [[FRRIngredientsViewController alloc] init];
    [window addSubview:self.ingredientsController.view];


    [window makeKeyAndVisible];

    return YES;
}

This small project reproduces this behavior:
Test Case

  • 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-20T21:24:51+00:00Added an answer on May 20, 2026 at 9:24 pm

    I found the error, guys.

    Basically I was trusting the system to correctly set the frame of my views to match the usable portion of the screen. This works when you add it to some controller of controllers (such as UINavigationController), or add it via IB.

    If you add your controllers programmatically, you need to set the view’s frame explicitly. A good default is:

    [[UIScreen mainScreen] applicationFrame] 
    

    represents the part of the screen available to applications: the whole screen minus the status bar.

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

Sidebar

Related Questions

I have a very simple Mac Cocoa app that just has a Web View
I have an iPhone app that shows a simple view (View 1) that has
I have a simple cakephp app with table articles that has a cat_id column
I have an activity that has two tabs and a list view in each.
I have a simple app that has a list of clients in one table
I have an app that has a viewflipper to keep tabs in view at
This is a real newbie question. I have simple app that selects a picture
I have a simple app that uses an SQL Express 2005 database. When the
Right so I have a simple app that consists of a calendar a Set
I'm now testing GKPeerPickerController. I have a simple app that just have a button

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.