I’m following the example code from Apple to implement the new iPadOS 18 TabView()
with the new Tab()
. While the tabbing itself is working fine, I can’t get it to show up a (large) navigation title in the sidebar (like the Home or Files app).
I’ve tried placing .navigationTitle("App Name")
at the TabView, but that doesn’t work. Is it possible to do this in any way or is this not recommended to show?
TabView {
Tab("Overview", systemImage: "film") {
Text("Put a OverviewView here")
}
TabSection("Watch") {
Tab("Movies", systemImage: "film") {
Text("Put a MoviesView here")
}
Tab("TV Shows", systemImage: "tv") {
Text("Put a TVShowsView here")
}
}
TabSection("Listen") {
Tab("Music", systemImage: "music.note.list") {
Text("Put a MusicView here")
}
Tab("Podcasts", systemImage: "mic") {
Text("Put a PodcastsView here")
}
}
}
.tabViewStyle(.sidebarAdaptable)
.navigationTitle("App Name")
.navigationBarTitleDisplayMode(.large)
I know that there is also the .tabViewSidebarHeader()
modifier, but that adds any view above the scroll view content. Neither does that easily allow to make it look like the regular navigation title, nor does it actually display in the navigation bar at the top, when scrolling down.
Apart from using .tabViewSidebarHeader()
, there is no other supported way to achieve the desired functionality given the currently shipping system configurations.
You can please submit an enhancement request via Feedback Assistant (https://feedbackassistant.apple.com) and post the Feedback ID once you do.