2

please consider the following widget view (the entry.icon is a string which points to a resource where the file is an SVG):

case .accessoryCircular:
VStack{
    Image(entry.icon).resizable().padding().border(.red)
    Text("IN")
}

The image works if it's a PNG but now it's an SVG. I'm pretty much a SwiftUI noob, so I don't know how to get the image to work within the circular widget... or perhaps SVG isn't supported in lock screen widgets? The error message I'm getting from the preview is

The body of the Widget's entries contains an image of size(2094, 2010) which is beyond the maximum of (1418,8, 3067,2).

Do I have to set the size explicitly?? In that case, I have to hard-code it to some fixed widget size, right? I'd like to avoid that if possible. Grateful for the pointers.

Mathias
  • 3,879
  • 5
  • 36
  • 48

0 Answers0