Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如何从 SwiftUI 视图转到作为选项卡栏控制器一部分的特定视图控制器。我想从 SwiftUI 视图转到作为 UIKit 视图控制器的 UITabBarController 中的特定索引。(让我们假设第一个索引) - 这可能吗?
由于视图层次结构及其加载方式,如果您加载 SwiftUI 视图,然后转到 SwiftUI 选项卡视图(选项卡视图喜欢成为父视图),您将遇到几个问题。
首先,确保您的第一个视图包含在导航视图中。然后,当需要切换到选项卡栏视图时,要么激活导航链接,要么确保用户点击的按钮包含在导航链接中。