Post

Replies

Boosts

Views

Activity

Reply to NavigationSplitView hide sidebar toggle button
You can use the toolbar(_:for:) modifier on your sidebar view like this: .toolbar(.hidden, for: .navigationBar). You can find details in the documentation here. Here's the resulting view: struct SomeView: View { var body: some View { NavigationSplitView( columnVisibility: .constant(.all), sidebar: { Text("sidebar") .toolbar(.hidden, for: .navigationBar) }, detail: { Text("detail") } ) .navigationSplitViewStyle(.balanced) } } The first argument sets the visibility, and the second arguments specifies which bar to hide (which in your case is .navigationBar).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’23