gpt4 book ai didi

SwiftUI displayModeButtonItem 内部管理

转载 作者:行者123 更新时间:2023-12-04 11:08:25 24 4
gpt4 key购买 nike

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

[Assert] displayModeButtonItem is internally managed and not exposed for DoubleColumn style. Returning an empty, disconnected UIBarButtonItem to fulfill the non-null contract.
目前我在应用程序的入口点设置了导航 View ,就像这样
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,它在工作数周后突然开始崩溃)。我觉得这有点乱,我做错了什么。知道为什么吗?谢谢您的帮助!

最佳答案

在 iPhone 或 iPhone 模拟器上运行时,我在 Xcode 12.1 上得到了这个,但在 iPad 模拟器上没有。
将此附加到 NavigationView 为我修复了它。

.navigationViewStyle(StackNavigationViewStyle())

关于SwiftUI displayModeButtonItem 内部管理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63740788/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com