How do I support the taller iPhone 5 screen size?
Asked Answered
R

1

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.

Ruisdael answered 13/9, 2012 at 0:22 Comment(5)
So far the only setting I have seen that enables it is to add a new launch screen.Livelihood
As Ben said, have you added an appropriate "[email protected]" launch image?Soembawa
possible duplicate of How to deal with iPhone 5 screen size?Rhizome
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.Ruisdael
possible duplicate of How to develop or migrate apps for iPhone 5 screen resolution?Kalamazoo
A
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 [email protected] 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.

Anaesthesia answered 13/9, 2012 at 1:10 Comment(4)
What do you mean by " there is currently no known way to get full 1136 px height on the new screen." ? The [email protected] is only for the [email protected] file?Iodoform
I don't understand your question.Anaesthesia
I think I get what @Iodoform 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 [email protected] we knew the proper higher res image would be loaded on retina display. I though adding [email protected] would behave the same but it seems this doesn't work that way.Kurbash
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.Anaesthesia

© 2022 - 2024 — McMap. All rights reserved.