为什么 iOS 16 中弹出时导航标题显示方式会从大变为内联?

Jac*_*ers 9 swift swiftui swiftui-navigationview ios16 swiftui-navigationstack

当我从具有内联显示模式的推送视图中弹出时,最初较大的父视图的显示模式更改为内联,并且用户必须向下滚动标题才能恢复到其原始模式。

问:如何确保设置视图上始终显示大标题?

我使用的是 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 {
                            Text("Sign Out")
                                .foregroundColor(.black)
                        } icon: {
                            Image(systemName: "rectangle.portrait.and.arrow.right")
                        }
                        Spacer()
                        Image(systemName: "chevron.forward")
                            .foregroundColor(Color(red: 191/255, green: 191/255, blue: 191/255))
                            .fontWeight(.semibold)
                            .imageScale(.small)
                    }
                }
            } header: {
                Text("Your account")
            }
        }
        .navigationTitle("Settings")
        .navigationBarTitleDisplayMode(.large)
        .sheet(isPresented: $isPresentingChangePasswordView) {
            ChangePasswordView()
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

主页视图

struct HomeView: View {
    var body: some View {
        NavigationStack {
            Text("HomeView")
                .toolbar {
                    NavigationLink(destination: SettingsView()) {
                        Image(systemName: "gearshape")
                            .foregroundColor(.gray)
                    }
                }
                .navigationTitle("Home")
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

更新#1

当用 NavigationView 替换 NavigationStack 时,它完全按照我想要的方式工作。虽然这是我正在寻找的,但我不会认为它是答案,因为苹果已经宣布 NavigationView将在 iOS 16 中弃用