SwiftUI [SwiftUI] No image named found in asset catalog for main bundle

SwiftUI [SwiftUI] No image named found in asset catalog for main bundle

There are two ways to load the image SwiftUI

  • One kind into Assets.xcassets folder
Image("文件名")
  • A direct into the project
Image(uiImage: UIImage(imageLiteralResourceName: "文件名.文件格式"))

problem solved

No image named found appear in asset catalog for main bundle problem is usually not the proper use of good loading mode


More attention SwiftUI tutorials and code columns

Published 637 original articles · won praise 4 · views 50000 +

Guess you like

Origin blog.csdn.net/iCloudEnd/article/details/104068346