How to activate @2x high res graphics for retina display?

自古美人都是妖i 提交于 2019-12-06 08:16:45

it's a known issue with imageWithContentsOfFile:. In API docs, it says it should work, in reality it doesn't (didn't work in 4.0.x, not sure about newer). They'll fix it one day.

Apple bug: http://openradar.appspot.com/8160592

Ugly, but a good workaround: http://hi.baidu.com/myguru/blog/item/11d12587e7c92524c65cc3ad.html

Make sure you're using [UIImage imageNamed: @"name"]. If you're using a device with a Retina display, it automatically appends the filename with @2x so it loads the right image.

How are you accessing the images? Anything placed into a UIImageView or UIButton, or retrieved with +[UIImage imageNamed:] should work fine. Are you sure your @2x images are EXACTLY 2 times the height and width of the originals?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!