HomeiOS Developmentswift - Learn how to take away iOS Residence display widget padding...

swift – Learn how to take away iOS Residence display widget padding (iOS 16+)


i am unable to take away the content material padding / content material margin from from this house display widget. The widget is of a picture

I’ve tried

            ZStack {
                if let url = URL(string: imageUrl), !imageUrl.isEmpty {
                    if let information = attempt? Knowledge(contentsOf: url),
                        let uiImage = UIImage(information: information) {
                        Picture(uiImage: uiImage)
                            .resizable()
                            .scaledToFill()
                            .body(maxWidth: .infinity, maxHeight: .infinity)
                            .ignoresSafeArea() 
                    } else {
                        Picture(systemName: "xmark.circle.fill")
                            .resizable()
                            .scaledToFit()
                            .foregroundColor(.purple)
                            .padding()
                    }
                } else {
                    VStack {
                        Picture(systemName: "picture")
                            .resizable()
                            .scaledToFit()
                            .foregroundColor(.grey)
                            .padding()
                        Textual content("No picture set")
                            .font(.caption)
                            .foregroundColor(.secondary)
                    }
                }
            }.widgetContentMargins(.none)

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments