Reputation: 31
I have an Hstack with two components. One is a drop-down menu, and the other is a nav link to "forgot password" page. I can't figure out why it won't go all the way to the top of the page.
I've tried inserting Spacer() on the very bottom (but within the bounds) of the HStack() code, won't move at all. I've tried putting additional objects and texts below and see if it would push up with a Spacer() below the new object, still wouldn't budge.
var body: some View {
VStack{
NavigationView{
HStack{
DropDownNewUser()
Spacer()
NavigationLink(destination: ForgotPasswordView()) {
Image(systemName: "questionmark")
.padding(15)
.background(lightgold)
.cornerRadius(50)
.foregroundColor(.white)
}
}.padding(10).edgesIgnoringSafeArea(.all)
}
}
Upvotes: 1
Views: 1234
Reputation: 257493
Put VStack
with Spacer
inside, as below
var body: some View {
NavigationView{
VStack{ // << here !!
HStack{
DropDownNewUser()
Spacer()
NavigationLink(destination: ForgotPasswordView()) {
Image(systemName: "questionmark")
.padding(15)
.background(lightgold)
.cornerRadius(50)
.foregroundColor(.white)
}
}.padding(10).edgesIgnoringSafeArea(.all)
Spacer() // << here !!
}
}
}
Upvotes: 2