Post

Replies

Boosts

Views

Activity

SwiftUI: Hiding the status bar with TabView and nested NavigationView's
Using XCode 12 Beta and iOS 14, I'm unable to hide the status bar when a NavigationView is nested inside a TabView. Consider:      TabView(selection: $selection) {        NavigationView {         ViewOne()         .navigationBarTitle("View One")       }       .tabItem {         Label("View One", systemImage: "doc.plaintext")       }       .tag(TabItem.viewOne)       .statusBar(hidden: true)     } The above code only hides the status bar if you remove the parent TabView. I also tried to hide the status bar onAppear:      TabView(selection: $selection) {        NavigationView {         ViewOne()         .navigationBarTitle("View One")         .onAppear {           isStatusBarHidden = true         }         .onDisappear {           isStatusBarHidden = false         }       }       .tabItem {         Label("View One", systemImage: "doc.plaintext")       }       .tag(TabItem.viewOne)       .statusBar(hidden: isStatusBarHidden)     } This also doesn't work. I've also tried hiding the status bar directly on the TabView. Any suggestions?
9
0
8k
Jul ’20