Reputation: 820
From some reason when I use the iPhone 5 screen in xcode everything is in 340x640 mode instead of 640x1136.
For example I have a design ready for iPhone 5, lets say I set the background to 640x1136 it much bigger from the screen in Interface builder and in the simulator. If I set the background to 340x640 every thing is grate.
The problem is with buttons and navigation bar. when I set the navigation bar background image it take 1/4 of the screen. because the design is for 1136x640.
But anyone have any idea how to fix it? Or handle it?
This is an image of the main view(interface builder generated)
Edit: now I notice it's even not 640h weird :|
Upvotes: 3
Views: 3977
Reputation: 17372
The reference point system never changes for retina devices.
so iPhone 3 vs iPhone 4 the point grid is 320 x 480 regardless of the screen resolution.
Likewise iPad 1 vs iPad 3 the point grid is 1024 x 768.
So for iPhone 5 the point grid is 320 x 568.
You program for the screen size but provide images at 2x resolution which then render correctly on retina screens as they have the extra info.
When you create your graphics you provide two images one at 2x resolution. So for a graphic foo
at 50 points x 50 points you provide foo.png
at 50 pixels x 50 pixels and [email protected]
at 100 pixels x 100 pixels for retina displays.
For example, when you ask for imageNamed:@"foo"
the system automatically looks for foo@2x
for a retina screen and if it can find it , then the image is used. Otherwise foo.png
is used and you get furry images in retina devices.
Upvotes: 7