I am trying to use NavigationView
and NavigationLink
in my code below.
I heard that NavigationLink
only works inside NavigationView
.
However, whenever I embed my ScrollView
into a NavigationView
, the scrollView stop showing up and I get a blank space. I am not sure what is the reason behind it.
var body: some View {
// I tried to embed the entire VStack into NaviationView. However, it ends up showing nothing as well
VStack(alignment: .leading) {
Text(self.categoryName)
.font(.title)
NavigationView {
ScrollView(.horizontal, showsIndicators: false) {
HStack(alignment: .top) {
ForEach (self.drummers) { drummer in
NavigationLink("Moreinfo", destination: drummerDetail(drummer: drummer))
aDrummer(drummer: drummer)
.frame(width: 300)
.padding(.trailing, 30)
}
}
}
.padding()
}
}
}