Sorry to repeat this, but the new style forum won't allow me access to the original version of this question, and the answers.
I have been searching the internet for 3 or 4 days now to find only complex solutions that I cannot get working.
All I want to do is determine when the device orientation changes so that I can update the background Image. This is what I have so far:
Import SwiftUI
struct Main_Menu_iPhone: View {
@State private var bloodGlucose: Float = 0.0
var body: some View {
ZStack {
Image("iPhone Background Portrait 828 x 1792 ")
.resizable()
.aspectRatio(contentMode: .fill)
VStack {
HStack {
Label("Blood Glucose", systemImage: "drop.fill")
TextField("Blood Glucose : ", value: $bloodGlucose, format: .number)
.onSubmit() {
print("Your Blood Gluse is : \(bloodGlucose)")
}
.background(.white)
.frame(alignment: .topTrailing)
Spacer()
}
Spacer()
}.padding(.top, 250)
}
}
}