【发布时间】:2023-03-10 14:42:01
【问题描述】:
每次我导航到另一个屏幕时,我都会在控制台中收到此消息:
[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)
}
}
一切似乎都在工作,但就在几个小时前它没有(我正在使用标签栏,但在工作了几周后它突然开始崩溃)。我觉得这有点乱,我做错了什么。知道为什么吗?感谢您的帮助!
【问题讨论】: