I have a view with hidden navigation bar, but I need to show the navigation bar with back button when user select a value from picker.
When I add a leading button, my code shows all country texts as one item instead of making each Text in separate selectable row.
Any idea how to fix this issue?
VStack{
Form {
Picker(selection: $selectedCountry, label: HStack {
Text("Country")
}) {
ForEach(0 ..< countries.count) {
Text(self.countries[$0])
}
.navigationBarItems(leading: BackButton())
.navigationBarBackButtonHidden(true)
.navigationBarHidden(false)
}
.navigationBarHidden(true)
.navigationBarBackButtonHidden(false)
}
}.navigationBarTitle("")
.navigationBarHidden(true)
