Present the old small title of UINavigationBar in SwiftUI NavigationView Present the old small title of UINavigationBar in SwiftUI NavigationView ios ios

Present the old small title of UINavigationBar in SwiftUI NavigationView


It is possible by passing displayMode: .inline attribute to navigationBarTitle()

NavigationView {  List {    Text("Text")  }.navigationBarTitle(Text("Title"), displayMode: .inline)}


SwiftUI 2 / iOS 14

Starting from iOS 14 the navigationBarTitle modifier is deprecated.

Instead we should "Use navigationTitle(_:) with navigationBarTitleDisplayMode(_:)":

List {    Text("Text")}.navigationTitle("Title").navigationBarTitleDisplayMode(.inline)


matomo