I am trying to move the images in Horizontal ScrollView up top. They are currently at the bottom. I have tried adding NavigationView
, .padding()
, Spacer()
, Adding a ZStack
as a parent to HStack
, and HStack(alignment: .top)
. I have been stuck for 3 days.
Is it possible to have Horizontal ScrollView up top?
Here is the code:
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
ScrollView(.horizontal) {
HStack(spacing: 15) {
Group {
Image("OutdoorDining1")
.frame(width: 230, height: 148)
Image("EatVegan")
.frame(width: 230, height: 148)
Image("CityView")
.frame(width: 230, height: 148)
Image("LiveMusic")
.frame(width: 230, height: 148)
}
Group {
Image("Seafood")
.frame(width: 230, height: 148)
Image("Blackowned")
.frame(width: 230, height: 148)
Image("Hookah")
.frame(width: 230, height: 148)
Image("OpenTilLate")
.frame(width: 230, height: 148)
}
Group {
Image("CentralAmerica")
.frame(width: 230, height: 148)
Image("Asian")
.frame(width: 230, height: 148)
Image("Mediterranean")
.frame(width: 230, height: 148)
}
Group {
Image("Steakhouses")
.frame(width: 230, height: 148)
Image("Kosher")
.frame(width: 230, height: 148)
}