首页 > 解决方案 > TabView 内的 NavigationView:“更多...”溢出项中的 NavigationBar 重复

问题描述

When I use a NavigationView inside a TabView, when the tab ends up in the "More..." overflow item, SwiftUI adds another NavigationView around and the navigation bar title is not shown correctly as of iOS 14.4. 这似乎是 SwiftUI (FB9078166) 中的一个错误。是否有解决方法来获得正确的行为?

这是一个重现此问题的示例项目:https ://github.com/ralfebert/SwiftUITabItemOverflowBug 。当您通过“更多...”进入“垃圾箱”时,导航视图标题“垃圾箱”显示在实际导航栏下方:

额外的导航栏

标签: swiftui

解决方案


推荐阅读