Customizing Back Button in Column 2 "Content" in SplitView

Hi,

How can I customize the Back Button in Column 2 "Content" in SplitView, like changing its color, label, icon ? Also is it possible to keep it visible even when Column 1 is shown and make it work like toggling showing and hiding Column 1 ?

Kindest Regards

Answered by Vision Pro Engineer in 774686022

You can remove the toggle to show and hide the column with .toolbar(removing: .sidebarToggle) - https://developer.apple.com/documentation/swiftui/view/toolbar(removing:)

For the back button, if you're navigating to a detail view, you can use .navigationBarBackButtonHidden() - https://developer.apple.com/documentation/swiftui/view/navigationbarbackbuttonhidden(_:) - on the detail view to hide the back button

Accepted Answer

You can remove the toggle to show and hide the column with .toolbar(removing: .sidebarToggle) - https://developer.apple.com/documentation/swiftui/view/toolbar(removing:)

For the back button, if you're navigating to a detail view, you can use .navigationBarBackButtonHidden() - https://developer.apple.com/documentation/swiftui/view/navigationbarbackbuttonhidden(_:) - on the detail view to hide the back button

Thanks allot

Customizing Back Button in Column 2 "Content" in SplitView
 
 
Q