I want screen background image and the green should be at the top of the screen but with below code why green area with text and button in the middle i want it to be at the top of the screen
code:
struct AppointmentStep1: View {
@Environment(.dismiss) var dismiss
var body: some View {
ZStack {
// Background image
Image("home_bg")
.resizable()
.scaledToFill()
.edgesIgnoringSafeArea(.all)
VStack {
HStack {
Button {
dismiss()
} label: {
Image(systemName: "arrow.left")
.font(.system(size: 25))
.tint(.white)
.padding(.trailing, 6)
}
Text("Appointment")
.font(.calibriRegular(with: 20))
.foregroundStyle(.white)
Spacer()
}
.padding(16)
}
.background(
Color.appGreen2
.ignoresSafeArea()
)
Spacer()
}
}
}
o/p: how to move the green view to top