4

I have my images Assets.xcassets, and try to load it in my Widget View. To use images in widget too, I already set target membership for widget extension. But the problem is it cannot load certain images (ex. HalloweenOne, HalloweenTwo, HalloweenThree). The size of every images is under 10kb. (All of the images are loaded well in a app.)

Image("HalloweenOne")
    .resizable()
    .aspectRatio(contentMode: .fit)
    .frame(maxWidth: 50)

enter image description here

naljin
  • 439
  • 3
  • 10

2 Answers2

6

I also encountered the same problem. After trying many methods, I solved the problem by changing the "Asset Catalog - Compression" on the right to "GPU Smallest Size".

YvenChen
  • 61
  • 1
  • 4
1

We have investigated this issue. There are a few reasons:

  1. The image should not be in SVG format, so use jpg or png.
  2. The width of the image should not be >= 1000.

If something is wrong, it will break all the elements of the widget.