I'm still trying to get my head around swiftUI by creating a log in form. I am trying to position the 'forgotPasswordImage' at the bottom of the white rounded rectangle and giving it the same width (and proportional height).
As you can see from the screen shot the 'forgotPassword' image does not sit at the bottom as I would expect. Interestingly it is the addition of the below methods to the image that cause it to move up.
Image("forgotPasswordBottom").resizable().relativeWidth(1).scaledToFit()
How can I position the image at the bottom of the rounded rectangle while applying a matching width and a height that maintains the correct aspect ratio.
thanks!
import SwiftUI
struct LogIn : View {
var body: some View {
ZStack{
Image("LoginBackground")
.resizable()
.aspectRatio(contentMode: .fill)
.edgesIgnoringSafeArea(.all)
RoundedRectangle(cornerRadius: 30).foregroundColor(.white).relativeSize(width: 0.8, height: 0.7)
VStack{
Spacer()
Image("forgotPasswordBottom").resizable().relativeWidth(1).scaledToFit()
}.relativeSize(width: 0.8, height: 0.7)
}
}
}