简体   繁体   English

NavigationView 分层堆栈中的 SwiftUI TabView 在屏幕顶部有额外的空间

[英]SwiftUI TabView in NavigationView hierarchical stack has extra space at the top of the screen

I have a flow of user registration.我有用户注册的流程。 Where Welcome screen wrapped in NavigationView and then after several screens NavigationLink opens TabView.欢迎屏幕包含在 NavigationView 中,然后在几个屏幕之后 NavigationLink 打开 TabView。 As I understand, as a result, TabView is in this navigation stack and has an extra space at the top of the screen.据我了解,因此,TabView 位于此导航堆栈中,并且在屏幕顶部有一个额外的空间。 How to avoid this situation?如何避免这种情况? I've tried this solution: https://stackoverflow.com/a/57332701/9325884 But it works only if you have one aka Login screen.我试过这个解决方案: https : //stackoverflow.com/a/57332701/9325884但它只有在你有一个 aka 登录屏幕时才有效。 So, I'm looking for a solution how to switch between two Navigation stacks.所以,我正在寻找如何在两个导航堆栈之间切换的解决方案。 TIA TIA

我在这篇文章中找到了一个解决方案 - 在这里链接并使用 @EnvironmentObject 来管理根据状态为我的用户显示的屏幕

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM