SwiftUI displayModeButtonItem由内部管理

问题描述

每次导航到另一个屏幕时,我都会在控制台中收到此消息:

[Assert] displayModeButtonItem is internally managed and not exposed for DoubleColumn style. Returning an empty,disconnected UIBarButtonItem to fulfill the non-null contract.

目前,我已经在应用的入口点设置了导航视图,

NavigationView {
        KeyboardView(matrixVM: matrixVM,isNavigationBarHidden: $isNavigationBarHidden)
            .background(Color("background")
            .edgesIgnoringSafeArea(.all))
            .navigationBarTitle("Workspace")
            .navigationBarHidden(self.isNavigationBarHidden)
            .onAppear {
                self.isNavigationBarHidden = true
        }
    }

然后在KeyboardView中有导航链接

NavigationLink(destination: NotebookView(isNavigationBarHidden: $isNavigationBarHidden,saved: matrixVM),label: {
                            Text("Notebooks")
                                .font(.system(size: 14,design: .rounded))
                                .fontWeight(.medium)
                                .foregroundColor(Color("text"))
                                .padding(.trailing,10)
                        })

在NotebookView中,我有一个导航链接列表(每个笔记本都链接到其详细信息页面)

ScrollView(showsIndicators: false) {
                        ForEach(notebooks,id: \.self) { notebook in
                            
                            NavigationLink(destination: ExpandedSnippet(matrixVM: saved,notebook: notebook)
                                            .navigationBarTitle("Notebook",displayMode: .inline)) {
                                SnippetCard(notebook: notebook,matrixVM: saved)
                                    .frame(width: UIScreen.main.bounds.width)
                            }
                            .padding(.bottom,30)
                        }
                    }

一切似乎都可以正常运行,但是仅在几个小时前却没有运行(我使用的是Tabbar,工作了几周后突然开始崩溃)。我觉得这有点乱,我做错了什么。知道为什么吗?感谢您的帮助!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)