Referencing image in a folder in asset catalog

后端 未结 2 1616
孤独总比滥情好
孤独总比滥情好 2021-02-05 04:00

In an asset catalog you can create folders.

Inside the folders all the image names have to be unique.

If you have an image called myImage and you tr

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-05 04:31

    I spent a ton of time but finally figured this out. Answered here. Copied below.

    Select each folder in your asset catalog that you'd like to add a namespace for. Go to the folder attributes and select under the name "Provides Namespace". This should properly set sub-directories for your final asset catalog.

    You can do this manually by editing each folder's Contents.json. You would add the following with proper formatting.

    "properties" : {
          "provides-namespace" : true
    }
    

提交回复
热议问题