In a SwiftUI project I try to display a background image with ignoring safe area insets (to make it go edge to edge). However, the background scales incorrectly and doesn't respect its aspect ratio.
Here is a small code example of the view structure that I'm using:
struct ContentView: View {
var body: some View {
ZStack {
Text("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.").padding()
}.frame(maxHeight: .infinity).background(Image("dots").resizable().ignoresSafeArea().scaledToFill())
}
}
And an example image for testing (when using this image you can clearly see the circles become more like ovals in the SwiftUI app):
Screenshot: