digga
digga

Reputation: 103

Size of Tabbar Image

Currently I am designing the UITabbar of my App. I created a Photoshop layout for the Tabbar, it is 84px high and 640px wide. Is it the right way to create one image with the size of 84x640 and one with the size 320x42. And then name the larger image @2x.png.

I am struggling at this point, because when I log the width of the UITabbar it says 320.00, but I am using the Iphone 3.5inch retina simulator.

Any tips for me to realize the tabbar?

Upvotes: 3

Views: 2694

Answers (2)

Boris Prohaska
Boris Prohaska

Reputation: 912

You confused "Points" with "Pixels". The Points are resolution independent. You can normally check your scale factor by calling contentScaleFactor on your UIView.

It should say 2.0 for retina, and 1.0 for non retina.

Upvotes: 1

Nikola Kirev
Nikola Kirev

Reputation: 3152

Yes. You should have two images. One for normal displays and one for retina. Xcode works with point, not pixels, so the width will always be 320. In the case of retina display one point is 2x2 pixels and in normal mode it is 1x1.

by the way, I think the height for the tab bar should be 320x49 for normal and 640x98 for retina.

the retina image should have the same name as the normal one with the @2x at the end

Example:

normal: image.png retina: [email protected]

Upvotes: 3

Related Questions