Skip to content

Instantly share code, notes, and snippets.

@Thunor
Created September 29, 2020 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Thunor/95fc7d39c8e0cbf8fa3bc6862c0b3d35 to your computer and use it in GitHub Desktop.
Save Thunor/95fc7d39c8e0cbf8fa3bc6862c0b3d35 to your computer and use it in GitHub Desktop.
Style the NavigationBar Title in SwiftUI
struct MyView: View {
var body: some View {
VStack {
Text("Hello World")
}
.navigationBarTitleDisplayMode(.inline)
.toolbar {
ToolbarItem(placement: .principal) {
HStack {
Image(systemName: "sun.min.fill")
Text("My Title")
.font(.headline)
.foregroundColor(.white)
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment