jpg images in iphone and 2x images

前端 未结 5 1807
傲寒
傲寒 2021-02-04 01:33

I am working on an iphone app and targeting iOS 4.0 or later. I am trying to add an image to UIImageView, and image is in jpeg format. This i

5条回答
  •  抹茶落季
    2021-02-04 02:06

    You just need to provide the full name of image.

    bgImageView.image = [UIImage imageNamed:@"background.jpg"]; 
    

    don't leave off the extension.

    As for the @2x, it is not necessary to call it out anywhere in the code. If you code correctly there is no need to test for a retina display as some here have suggested.

提交回复
热议问题