I've the following code which displays a master-detail view on iPad when in landscape. However, when I use NavigationStack it collapses views as on iPhone. What am I missing here? Or how to achieve this another way?
struct OwnersView: View {
@StateObject var vm: OwnersVM
var body: some View {
NavigationView {
TabView {
ForEach(vm.owners) { owner in
VStack {
Spacer()
Image(systemName: "person.circle")
.resizable()
.frame(width: 200, height: 200)
Text(owner.name)
Spacer()
HStack {
NavigationLink(destination: Text("\(owner.name) gold piece list")) {
Image("jewelry-filled")
}
NavigationLink(destination: Text("\(owner.name) cash list")) {
Image("cash-filled")
}
NavigationLink(destination: Text("\(owner.name) some other list")) {
Image("zakah-filled")
}
}
Spacer()
Spacer()
}
}
}
.navigationTitle("Owners")
.tabViewStyle(.page(indexDisplayMode: .always))
.indexViewStyle(.page(backgroundDisplayMode: .always))
}
}
}