1

I want to get the width and height of the screen, with this code ...

float screenWidth = [UIScreen mainScreen].bounds.size.width; float screenHeight = [UIScreen mainScreen].bounds.size.height; NSLog(@"%f %f",screenWidth, screenHeight); 

I get always 320 480 , but these aren't the true measures of the simulator. Now I'm testing on a retina simulator with more resolution, but i always get 320 480

0

1 Answer 1

2

I think your answer can be found here: in iPhone App How to detect the screen resolution of the device

Its the scale that interests you as well. Use CGFloat screenScale = [[UIScreen mainScreen] scale]; to find out the scale.

When positioning elements your points should always be in non-retina scale. Size of the screen for 3.5 inch is 320x480 units and 320x568 for the 4 inch screen. The pixel resolution is times two for retina screens.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.