iOS 16 Image() in LockScreen Widget

Viewed 27

I want to create lockscreen widget to display a single image (company logo). I have the basic setup in latest beta Xcode and iPhone 12 Pro Max also latest iOS 16 Beta. Here is code:

struct ZKLogoEntryView : View {
var entry: Provider.Entry

    var body: some View {
        Image("logoW")
        .resizable()
        .scaledToFit()
    }
}

It is working in canvas, displaying company logo, but doesn't work on device. See screenshots: Xcode and iPhone

So, am I doing this correct? Maybe Image() not even working in lockscreen widgets? Any other ways to do that?

1 Answers

Everything was correct! The problem was in image parameters! I had to use photoshop to create image with correct size, color, dpi, format. You can find all that specs in apple developer documents. Thanks!

Related