我不了解navigationBarTitle()和navigationTitle()之间的确切区别。有人可以解释何时使用哪种吗?
答案 0 :(得分:2)
navigationTitle
只是SwiftUI 2.0的替代品,已弃用的SwiftUI 1.0 navigationBarTitle
@available(iOS, introduced: 13.0, deprecated: 100000.0, renamed: "navigationTitle(_:)")
@available(macOS, unavailable)
@available(tvOS, introduced: 13.0, deprecated: 100000.0, renamed: "navigationTitle(_:)")
@available(watchOS, introduced: 6.0, deprecated: 100000.0, renamed: "navigationTitle(_:)")
public func navigationBarTitle(_ title: Text) -> some View