Please can someone help I have spent 3 - 4 days trawling the internet and only finding complex answers that I can't get to work, and my head is ready to explode.
I only want to detect when the device orientation has changed and load a different background image. This is what I have so far:
import SwiftUI
struct Main_Menu_iPhone: View {
@State private var bloodGlucose: String = "0.0"
var body: some View {
ZStack {
Image("iPhone Background Portrait 828 x 1792 ")
.resizable()
.aspectRatio(contentMode: .fill)
VStack {
TextField("Blood Glucose : ", text: $bloodGlucose)
Spacer()
}
}
}
}
#Preview {
Main_Menu_iPhone()
}