Saturday, December 30, 2023
HomeiOS Developmentswift - Toolbar backside iOS 16 - SwiftUI

swift – Toolbar backside iOS 16 – SwiftUI


toolbar is dependent upon the navigation bar so you must have a NavigationView/NavigationStack

https://developer.apple.com/documentation/swiftui/view/toolbar(content material:)-5w0tj

struct ToolbarSolutionView: View {
    var physique: some View {
        NavigationView{ //NavigationStack
            Textual content("Content material")
            
                .toolbar {
                    ToolbarItemGroup(placement: .bottomBar) {
                        Button("Greeting") {
                            print("Hiya world!")
                        }
                    }
                }
        }
    }
}

It was seemingly a bug that it was working earlier than.

You’ll be able to conceal the navigation bar for those who do not want it.

//iOS 13+
.navigationBarHidden(true)

//iOS 16+
.toolbar(.hidden, for: .navigationBar)



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments