When creating a principal ToolbarItem in a sidebarAdaptable TabView, unwanted space appears at the top.
Here's my code:
struct ContentView: View {
var body: some View {
TabView {
Tab("Tab", systemImage: "star") {
NavigationStack {
Text("Hello, World!")
.toolbar {
ToolbarItem(placement: .principal) {
Text("↑ Space")
}
}
.navigationBarTitleDisplayMode(.inline)
}
}
}
.tabViewStyle(.sidebarAdaptable)
}
}
I would like to know how to remove this space.
Environment:
- Xcode 16.2.0
- iOS 18.2