Until now the default displayMode
for UINavigationItem
was small title and it changed in SwiftUI to be large by default.
Is it possible to use the old small title style?
Starting from iOS 14 the navigationBarTitle
modifier is deprecated .
Instead we should:
"Use navigationTitle( :) with navigationBarTitleDisplayMode( :)"
List {
Text("Text")
}
.navigationTitle("Title")
.navigationBarTitleDisplayMode(.inline)
It is possible by passing displayMode: .inline
attribute to navigationBarTitle()
NavigationView {
List {
Text("Text")
}.navigationBarTitle(Text("Title"), displayMode: .inline)
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.