Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

ios

size

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.

like image 268
ghostrider Avatar asked Dec 14 '14 13:12

ghostrider


2 Answers

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

like image 176
Janmenjaya Avatar answered Nov 15 '22 04:11

Janmenjaya


Launch Images are outdated. Add a single resizable Launch Screen and you will always get native resolution in iOS 8 (which is oldest OS the iPhone 6 will run anyway).

Go to File > New > File > iOS User Interface > Launch Screen.

Make a Storyboard launch screen. This will work for any sized screen, present or future.

Go to the "General" tab for your app target. In the "App Icons and Launch Images" section, choose the Launch Screen File you just made.

like image 26
w0mbat Avatar answered Nov 15 '22 03:11

w0mbat