我使用协调器在页面之间导航
navController.setNavigationBarHidden(true, animated: false)
navController.pushViewController(u, animated: true)
var body: some View {
NavigationView {
VStack {
HeaderTopNotification()
ScrollView {
VStack(alignment: .leading){
ForEach(1..<10) { _ in
Section {
Text("day")
.frame(maxWidth: .infinity,alignment: .leading)
.padding(.vertical,12.h)
VStack (alignment: .leading,spacing: 8.h){
ForEach(0..<10) { _ in
NotificationCardView()
}
}
}
}
}
}
.background(content: {
Colors.backgroundUIView.toColor
})
.padding(.horizontal,Constant.marginScreen)
}
.navigationTitle("Notifications")
.navigationBarTitleDisplayMode(.inline)
.toolbarBackground(.visible, for: .navigationBar)
.toolbarBackground(Colors.background.toColor, for: .navigationBar)
}
}
}
当我删除导航视图时隐藏并正常工作
将 UIKIT 与 SwiftUI 连接并将 swiftui 屏幕推送到 UINAvigationController