导航标题问题

时间:2021-01-22 11:04:38

标签: swiftui swiftui-navigationlink swiftui-navigationview

我有一个列表视图的导航标题。来回导航后,我的导航标题不见了。我是 swiftui 的新手,无法调试。请帮忙。

    var body: some View {
    
    NavigationView {
        
        VStack {
            
            TabView(selection: $choice,
                    content:  {
                        
                        OPListCell()

                        IPListCell()
                        
                    })
                .tabViewStyle(PageTabViewStyle())
            
        }
        .listStyle(PlainListStyle())
        .navigationBarTitle("My Patients")
        .toolbar {
            ToolbarItem(placement: .principal) {
                
                HStack {
                    Picker(selection: self.$choice, label: Text("")) {
                        ForEach(0 ..< self.choices.count) {
                            Text(self.choices[$0])
                        }
                    }
                    .frame(width: 175)
                    .pickerStyle(SegmentedPickerStyle())
                    .padding(.leading, 10)
                }
            }
            
        }
        
    }
    
}

}

enter image description here

0 个答案:

没有答案