开发者

@2x images do not display in XCode4 interface builder designer

I'm trying to design a xib using XCode4, but when I put down an image view that displays an @2x image xcode doesn't preview it correctly (it displays a missing image icon). It works correctly when the app is run though.

As an example: I add a UIImageView to my view and set the image property to test.png. In my project I add a file named test@2x.png.

In XCode 3.2 this image would have correctly displayed in IB, and the @2x version would have automatically half-sized on non-retina devices.

However in IB in XCode4 the image doe开发者_运维技巧s not display.

Is anyone else experiencing this? If they are, it's a pretty massive issue.


Why not just add both images? AFAIK UIImage isn’t guaranteed to work like that.


I always use both sizes, having the @2x ones first, and unretining them using the free app unretiner from app store, and drop both sizes to the project. When referring to an image, instead of writing test.png or test@2x.png, I write test and xCode finds sizes to the corresponding devices, but YES! in IB, the image won't be displayed in this way, just a question marked blue screen; but that works fine when running the app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜