Image resources for iOS

前端 未结 5 626
天命终不由人
天命终不由人 2020-12-05 00:29

I\'m probably missing something obvious here, yet I\'ve been unable to solve the following problem:

I have a project with image resources for both normal and retina

5条回答
  •  温柔的废话
    2020-12-05 01:12

    Have you tried to simply load the image using:

    UIImage * someImage = [UIImage imageNamed: @"someimage"];
    

    (assuming your have an image named 'someimage' in you project, for example someimage.png)

    The code will automatically pick retina/non-retina versions depending on the platform.

    If the problem is that the TIFF are created, check:

    XCode Combine high-resolution artwork

    In latest version of XCode, go to the Editor menu, then select "validate settings", which should remove that artwork combination.

提交回复
热议问题