开发者

(Quick Question) UITableViewCell background image - maintaining resolution for retina graphics

开发者 https://www.devze.com 2023-03-27 19:41 出处:网络
I have a UITableviewCell that loads its background from an image, my question is, how do i maintain resolution for the retina display?

I have a UITableviewCell that loads its background from an image, my question is, how do i maintain resolution for the retina display?

Do i have two of the same image in the project, such as...

  • CellBackground.png
  • CellBackground@2X.png

And Xcode will identify to use the second image if the device is iPhone 4?

or do i just include the o开发者_JS百科ne image at Retina resolution and Xcode will "shrink" the image to pre-Retina display?

Thanks


You should include the two images CellBackground.png and CellBackground@2x.png. Non-retina display iPhones have more limited RAM and processing power. Xcode doesn't shrink any images for you, so not including a non-retina image would force older phones to scale the background image from the higher resolution retina display image. This can only hurt your scrolling performance.

0

精彩评论

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