22

My app shows up letter boxed and I want it to stretch properly to fill the whole screen. I'm creating my main window with:

self.mainWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

But I'm still getting the letter boxed behavior. Is there some other setting I need to set to get the full size of the mainScreen on the device?

I'm trying to avoid using any launch images if I can. I've tried this:

self.mainWindow.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

and it doesn't seem to help. And I've looked through all the Info.plist options and found nothing that seems to match.

David Weiss
  • 1,842
  • 3
  • 17
  • 25
  • So far the only setting I have seen that enables it is to add a new launch screen. – Ben Trengrove Sep 13 '12 at 00:42
  • 2
    As Ben said, have you added an appropriate "Default-568h@2x.png" launch image? – Brad Larson Sep 13 '12 at 00:54
  • possible duplicate of [How to deal with iPhone 5 screen size?](http://stackoverflow.com/questions/12396545/how-to-deal-with-iphone-5-screen-size) – Jonathan Grynspan Sep 13 '12 at 01:41
  • The launch screen named and formatted as described below works, but I was looking for a method that didn't use a launch image. Looks like the answer is that the launch image is the only way to get the new behavior. – David Weiss Sep 13 '12 at 11:35
  • possible duplicate of [How to develop or migrate apps for iPhone 5 screen resolution?](http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution) – Peter O. Sep 15 '14 at 11:28

1 Answers1

27

I don't support your idea of avoiding launch images as they are there for a reason, but if you really wanna do it for some reason, you should use the Default-568h@2x.png file (640x1136 px) like the one you get when creating a new project. It's just solid black, doesn't take up a lot of disk space and will look as if there are no launch images whatsoever.

Besides setting a 4-inch retina launch image, there is currently no known way to get full 1136 px height on the new screen.

iwasrobbed
  • 46,496
  • 21
  • 150
  • 195
Filip Radelic
  • 26,607
  • 8
  • 71
  • 97
  • What do you mean by " there is currently no known way to get full 1136 px height on the new screen." ? The -568@2x.png is only for the Default@2x.png file? – JFMartin Oct 22 '12 at 00:11
  • 2
    I don't understand your question. – Filip Radelic Oct 22 '12 at 00:35
  • 3
    I think I get what @JFMartin says. How are we supposed to load images all over our app for the 4" display? We used image_name.png in our storyboad, for example, and providing image_name@2x.png we knew the proper higher res image would be loaded on retina display. I though adding -568@2x.png would behave the same but it seems this doesn't work that way. – Juan González Nov 10 '12 at 22:50
  • Well, retina was a new display scale, this is just a bit taller screen. There is really no point at having -568h suffix when only the default image is of that height. You can easily check for UIScreen mainScreen height and load 4-inch-screen-specific images if you really need to. – Filip Radelic Nov 10 '12 at 22:55