My tab bar icons appear blurry.
I created the icons using Photoshop, and followed the iOS Human Interface Guidelines when I decided the sizes of each icons.
e.g. icon size: 30x30px png
This only happens with the tab bar. I wonder if this happens because of the resolution of the images or because of programming issues…
4
Answers
Probably because using a device with the retina screen.
Try about changing the icon’s filename to [email protected] like “[email protected]”.
You’re using icon size
30x30
which I assume is for1x
(iPhone<4). Since iPhone>=4 needs2x
and3x
images so you have to include that also.Either you use images with naming conventions like
or you can use
image.xcassets
and put your1x
,2x
and3x
images there and use it.Reference Xcode Assets Catalogs
Also, be aware that you can use a PDF file (vector graphics, resolution independent) instead of PNGs, and Xcode will render the appropriate resolutions at build time for you (I don’t think you can easily do this for third party icons such as Facebook, but…).
To see how this is done, create a new project using the “Tabbed Application” template, and check the asset catalog for the tab bar icon images. It does just that for the circle and square icons of the “First” and “Second” initial tabs.
Use this line of code to set image for uitabbaritem in uitabbar .