Basically I have a picture that is supposed to stretch the entire width of the screen, but when I fix the width to infinity - it pushes the frame width off the screen - like shown below.
Minimum Reproducible Code
import SwiftUI
struct ItemView: View {
var body: some View {
ZStack {
//Grey background color
Color(red: 0.9, green: 0.9, blue: 0.9).edgesIgnoringSafeArea(.all)
VStack {
Image("PS5")
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: .infinity, height: 250)
Spacer()
}
}
.ignoresSafeArea()
.navigationBarTitleDisplayMode(.inline)
}
}
struct ItemView_Previews: PreviewProvider {
static var previews: some View {
ItemView()
}
}
