iphone - Hi-Res @2x image not being picked up for tab bar item -
i have tabbarcontroller sets image tab so, in -init
method:
self.tabbaritem.image = [uiimage imagenamed:@"tabimage.png"];
i have tabimage@2x.png file in resource. in iphone 4 simulator or phone, hi-res image isn't being picked - low res version being scaled up.
any ideas why might be?
edit: more info: if try , explicitly use tabimage@2x.png
(or tabimage@2x
) tab image see extremely large , blown beyond bounds of tab, if it's being scaled 60px 120px. looks whatever name supply being treated scale=1.0 image.
note simulator not case-sensitive, device is. make sure case matches exactly. if you've changed case of filename @ point, you'll need clean , rebuild. sometimes, simulator, i've had blow away folder in library/application support/iphone simulator/4.3/applications/ rebuild pick renamed image.
always use
[uiimage imagenamed:@"foo.png"]
this work on 3.x , 4.x devices, , on 4.x simulator. devices retina displays (and 4.x simulator) magically pick @2x versions of images; ios has been modified smart function , @2x.png files.
make sure have both @2x.png , normal.png added project file, , full clean & build. others have mentioned, verify size of images, too; apparently if they're not 2x dimensions won't work (i haven't verified myself).
if leave .png off, work on ios 4.0. if you're building 4.0+ app, can ask for:
[uiimage imagenamed:@"foo"]
if have 1 hi-res image , want use on both retina , non-retina devices, you'll have change view.contentmode scale fit.
Comments
Post a Comment