I have a NavigationView at one of the previous views. But if I do not add another navigation view to this view I only see a navbar with default < Back button.
When I add navigation view to this view then I have double navigation bars
- one with < Back button
- one which I created
could not find a way how to get rid of this problem.
struct MainPageView: View {
@Environment(\.presentationMode) var mode: Binding<PresentationMode>
let screenWidth = screenSize.width
var sections = ["deniz", "kara"]
@State private var sectionIndex = 0
var body: some View {
ZStack {
Color(UIColor(currentSection()))
.edgesIgnoringSafeArea(.all)
ScrollView(.vertical, showsIndicators: false) { ... }
}
.navigationBarTitle("", displayMode: .large)
.navigationBarBackButtonHidden(true)
.navigationBarItems(
leading: HStack{
VStack {
ZStack {
Rectangle()
.fill(Color.clear)
.frame(width: screenWidth / 2, height: 50)
Section {
Picker(
selection: $sectionIndex,
label: Text("Sections")
) {
ForEach(0 ..< sections.count) {
Text(self.sections[$0])
}
}.pickerStyle(SegmentedPickerStyle())
}.padding(.horizontal, 10)
}
Spacer()
}
}
.padding(.leading, screenWidth / 5)
,trailing: HStack {
NavigationSliderItem()
NavigationSearchItem()
}
)
.navigationViewStyle(StackNavigationViewStyle())
if I insert NavigationView before ZStack this happens.
Navigation View is on Kayit ol page. You can see from the video