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

The Archive Base Latest Questions

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

I have been trying to understand why my modally presented image is not being

  • 0

I have been trying to understand why my modally presented image is not being shown underlaid the transparent status bar.
The _window.rootViewController is a UILayoutContainerView, part of the Tab view that is the first responder view defined in the Storyboard.

When the presentViewController message is sent to the rootViewController i can see in the call stack that

UIWindowController transition:fromViewController:toViewController:target:didEndSelector:

calls the setFrame of my coverImageViewController with 0,20,320,460 despite both the rootViewController and coverImageViewController having a frame of 0,0,320,480.
This means the image ends up being displayed modally underneath the status bar, compressed by 20 pixels.

My suspicion is that the UILayoutContainerView somehow changes in the transition, but I’m not sure how confirm it nor how to stop it.

Any help would be appreciated.
Thanks.

This is the source:

- (void)applicationDidFinishLaunching:(UIApplication *)application
{
    // Get the cover image (320x480) from the main bundle and put it in an image view.
    UIImage *coverImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"CoverPage.png" ofType:nil]];
    UIImageView *coverImageView = [[UIImageView alloc] initWithImage:coverImage];

    // Instantiate and set up the coverImageViewController.
    coverImageViewController = [[UIViewController alloc] init];

    // Desperate attempts to make image display below the status bar.
    [coverImageViewController setModalPresentationStyle:UIModalPresentationFullScreen];
    [coverImageViewController wantsFullScreenLayout];
    [_window.rootViewController wantsFullScreenLayout];

    [coverImageViewController setView:coverImageView];

    // Make the window visible. Without a visible window the modal view won't come up.
    [_window makeKeyAndVisible];

    // At this point I am sure that both the rootViewController and the coverImageViewController frames are 0,0,320,480
    // Display the coverImageViewController modally.
    [self.window.rootViewController presentViewController:coverImageViewController animated:NO completion:nil];
}

I made a test tab-bar based Storyboard project where I put the same code in appDelegate.m’s didFinishLaunchingWithOptions method.

It has the same problem.

I start the app up with a black transparent status bar and a distinctively patterned Default.png image that makes it clear that it is shown underneath the status bar.

Once the didFinishLaunching presentViewController is called it is clear to see that the same pattern cover image is shrunk by 20 pixels (I also confirm this with NSLog output) and shown below rather than beneath the status bar.

Hope anyone knows why presentViewController does this and how to stop it in a non bodgy way.

Thanks again.
Teo

Link to test project:
http://dl.dropbox.com/u/1792284/ModalSplashTest.zip

  • 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-26T11:50:21+00:00Added an answer on May 26, 2026 at 11:50 am

    I decided to have a look at it again this morning and decided the easiest (if slightly bogdgy) way to make this work is to setStatusBarHidden:YES before calling the presentViewController and :NO on the line after it.
    This has the effect of showing the modal view underneath the translucent status bar.

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

Sidebar

Related Questions

I have been trying to understand why it will not work for me. Im
I have been trying it for few days and I do not understand what
I have been trying to understand a bit more about the wider picture of
I have been trying to understand the way ActionScript's events are implemented, but I'm
For last 48 hours, I have been trying to understand Multithreading and Socket Programming
I have been trying to understand how they did those effects in http://artofflightmovie.com/ with
I have been trying to understand the internal implementation of java.util.HashMap and java.util.HashSet .
I program in Java and have been trying to understand exactly what operator overloading
It maybe a little naive question but I have been trying to understand how
I have been trying to understand the use of primitives in Java and C#

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.