This is driving me nuts. There seems to be new behaviour for handling background images in iOS14.
Desired effect is: a fixed background image that fills the screen, ignoring the safe areas, and is totally static when the keyboard pops up. Instead the keyboard makes the image slide to the right, even though the keyboard is rising from the bottom (??).
Is this a SwiftUI bug? Any ideas/workarounds appreciated.
The code to produce this is very small:
import SwiftUI
struct ContentView: View {
@State var name = "Name"
var body: some View {
GeometryReader { geometry in
VStack {
TextField("Placeholder", text: $name)
}
.frame(width: geometry.size.width, height: geometry.size.height)
.background(
Image("bricks")
.resizable()
.scaledToFill()
.edgesIgnoringSafeArea(.all)
)
}
}
}