开发者

High Resolution iPhone Background

开发者 https://www.devze.com 2023-01-11 05:59 出处:网络
According to Apple\'s website, the iPhone 4 is 960-by-640-pixel resolution at 326 ppi. I made an image with these specs, however when I put it onto my iPhone as a background for one of my applications

According to Apple's website, the iPhone 4 is 960-by-640-pixel resolution at 326 ppi. I made an image with these specs, however when I put it onto my iPhone as a background for one of my applications, it is way too big and you can only see the upper left corner of the image. How do I make it fit and how do I make a high resolution iPhone 4 background?开发者_高级运维


You need to give it the name "someImage@2x.png" with the important part being @2x so they can apply the scale correctly.

Realize though that you also need "someImage.png" which is half that size for devices without the retina display.

I always use the "someImage.png" file as the initial image and then the OS will automagically switch to the @2x image during runtime so don't worry about that. Just set it to the standard 320x480 or 480x320 and let the OS do the rest.


Are you using an UIImageView? You should have two versions of your images

  • image.png - normal 320x480 image for older phones
  • image@2x.png - for iphone4 with the 640x960 resolution

When you set the file location (be it programically or in Interface Builder) just tell it about the 'image.png'. The iPhone4 will automatically look for the '@2x' version.

0

精彩评论

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

关注公众号