Search code examples
iossizeiphone-6

return value of [UIScreen mainScreen].bounds.size.height on iphone 6


I am running my code on iphone 6 device, on portrait mode.

NSLog(@"main screen height : %f", [UIScreen mainScreen].bounds.size.height);

Why does it return 568.0 and not 667.0?

Mode on iPhone is Standard - not Zoomed.

EDIT : This happens even on simulator - when I choose device to be iphone 6.


Solution

  • Add the splash image for iPhone 6, then it will work as you want

    Click on images.xcassets, click on attribute inspector and choose iOS 8.0 and Later

    choose iOS 8.0 and Later

    then you will get option for two extra launch image like below Drag drop the retina size image for iPhone 6 and iPhone 6 plus in Retina HD 4.7 and Retina HD 5.5 respectively

    Add launch image for Retina HD