1

I wan't to make an app that is compatible with an iOS version as low as 5.0, but still keep it to stretch to the iPhone 5 size. I figured I made 3 different storyboards: one for iPad, iPhone and iPhone 5. I used

#define IS_IPHONE_5 ( fabs( ( double )[ [ UIScreen mainScreen ] bounds ].size.height - ( double )568 ) < DBL_EPSILON )

from this question

It was very strange when it didn't enter this code

if (IS_IPHONE_5 && UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

So, I figured to print the screen size to the console, using this code:

NSLog(@"%f", [UIScreen mainscreen].bounds.size.height);

Oddly, it gave me the output of

480.000000

instead of 568.f like it should be on a 4-inch device.

Things that might be the problem:

  1. I'm using the iPhone simulator, sorry I don't have an iPhone 5
  2. The app is iOS 5 compatible, which might be the problem

Note: I've tried on 4.6, and it still doesn't work

Community
  • 1
  • 1
JomanJi
  • 1,407
  • 1
  • 17
  • 27
  • Please edit your question title to be descriptive of the problem you're trying to solve! – stevekohls Jul 01 '13 at 15:16
  • Ok, sorry, It should be fixed by now, thanks for pointing that out – JomanJi Jul 01 '13 at 15:44
  • Are you actually using 568 pixels in your app and do they get filled? My guess would be that the User Interface(!) size get returned, not the actual hardware dimensions. But I haven't touched those APIs for some time now, I might be wrong. – Paul Jul 01 '13 at 16:04

1 Answers1

3

Your app is not iPhone 5 compatible. Hence, when you run the app on the iPhone 5 simulator, the compatibility mode for 3.5-inch screen turns on automatically, and your app doesn't occupy the entire screen.

Here you can see how to add iPhone 5 compatability to your app.

Community
  • 1
  • 1
StatusReport
  • 3,397
  • 1
  • 23
  • 31