当我从具有内联显示模式的推送视图中弹出时,最初较大的父视图的显示模式更改为内联,并且用户必须向下滚动标题才能恢复到其原始模式。
问:如何确保设置视图上始终显示大标题?
我使用的是 Xcode 14 beta 6,在预览中它不会发生,但在运行 iOS 16 的模拟器上它会发生。
struct SettingsView: View {
@State private var isPresentingChangePasswordView = false
var body: some View {
Form {
Section {
NavigationLink(destination: EmptyView()) {
Label("Account Details", systemImage: "person")
}
NavigationLink {
Form {
Button("Change Password") {
isPresentingChangePasswordView = true
}
}
.navigationTitle("Password & Security")
.navigationBarTitleDisplayMode(.inline)
} label: {
Label("Password & Security", systemImage: "lock")
}
NavigationLink(destination: EmptyView()) {
Label("Manage Subscription", systemImage: "crown")
}
Button {
} label: {
HStack {
Label …Run Code Online (Sandbox Code Playgroud) swift swiftui swiftui-navigationview ios16 swiftui-navigationstack