Home > AI > IOS > SwiftUI >

statusBar

Example:

struct ContentView: View {
    @State var hideStatusBar = false

    var body: some View {
        Button("Toggle Status Bar") {
            withAnimation {
                self.hideStatusBar.toggle()
            }
        }
        .statusBar(hidden: hideStatusBar)
    }
}

Leave a Reply