Getting wrong screen resolution on iPod touch or iPhone 5? Launch image woes… (iOS)

I was working on improving my existing game Concussion Boxing and adding a new block move.

Part of it was replacing the splash screen and icon into a better looking ones.

Newer generations of iPhones and iPods have a 4 inch display and a non retina resolution of 320×568 while older devices with a 3.5 inch screen have only 320×480.

In AppDelegate I would load the correct xib file to match the screen resolution.

I would use: [[UIScreen mainScreen] bounds].size.height to figure out which screen resolution my device has.

However, for my iPod touch 5 with iOS 7 on it I would get the wrong resolution(320×480) from the bounds property instead of the 4 inch resolution.

It turns out that not having the correct Launch images set up for the application could prevent your app from running with the correct resolution for the device.

Setting the launch images is a bit tricky, you need to set the exact correct file names in order for this to work.

This post show you the correct naming for the launch images:

http://stackoverflow.com/questions/18624587/how-do-you-update-the-app-icons-and-launch-images-to-support-ios-6-and-7-simulta

Even after naming correctly your launch images you may get a black splash screen instead of the image you have set.

This is due to the fact that PNG files have several types of formats and not all of them are displayed correctly.

In my case a PNG image with transparency(32 bit pixels) was not  displayed while saving the image in 24 bit with Paint.Net worked and displayed correctly.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s