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

前端 未结 6 1584
南笙
南笙 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: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!

提交回复
热议问题