How can I tell Asset Catalog (.xcassets) to use the Same Image for Multiple Image Wells?

前端 未结 6 1542
南笙
南笙 2021-02-02 08:50

We have several Xcode app projects, and we\'re upgrading all of them to use the latest Xcode 5 features, including Asset Catalogs (.xcassets).

All of our

相关标签:
6条回答
  • 2021-02-02 09:04

    I solved this by removing old xcassets and added new xcassets by using Don't use app catalogs

    0 讨论(0)
  • 2021-02-02 09:04

    I upgraded to cocopods 0.37 and the problem was solved. If you used cocopods then it was probably its fault.

    0 讨论(0)
  • In my case I am using cocoa pods. The cocoa pods script Pods-resources.sh somehow caused the problem. Removing the asset parts from the script solved the problem.

    Make sure to clean your project and delete derived data folder.

    Parts to be deleted can be found here:

    https://stackoverflow.com/a/21309102/832111

    0 讨论(0)
  • 2021-02-02 09:17

    I solved this by using build scripts to copy the right xcassets file in for each target. Details here

    0 讨论(0)
  • 2021-02-02 09:20

    You can right click on the .xcassets file and choose 'Show in Finder'. Go to the 'Image.launchimage' folder and open the Contents.json file in a text editor. Here you can see that unassigned slots don't contain an "filename". You can add this manually. For example change the following:

    {
        "orientation" : "landscape",
        "idiom" : "ipad",
        "extent" : "full-screen",
        "minimum-system-version" : "7.0",
        "scale" : "2x"
    }
    

    Into:

    {
        "orientation" : "landscape",
        "idiom" : "ipad",
        "extent" : "full-screen",
        "minimum-system-version" : "7.0",
        "filename" : "Default-Landscape@2x~ipad.png",
        "scale" : "2x"
    }
    

    Now safe the file, and voila!

    0 讨论(0)
  • 2021-02-02 09:24

    I think I've found the solution: Simply drag the default images that you want to be used for iOS 6 and 7 into the iOS 6 bucket. You get a warning about not having an iOS7-only image but the build works in the iOS7 simulato, an iOS7 iPhone and an iOS7 iPad.

    0 讨论(0)
提交回复
热议问题