gpt4 book ai didi

swift - 控制嵌套的 UITabController

转载 作者:行者123 更新时间:2023-11-28 05:50:12 27 4
gpt4 key购买 nike

我有两个 UITabController。一个是可从嵌套在第一个 UITabController 范围内的 UIViewController(在层次结构中较低)控制的。当我更改层次结构中较低的一个的 selectedIndex 时,它也会更改另一个。我已经尝试了很多东西(见下文),但似乎没有任何效果。知道我如何控制一个而不是另一个。

// Controls both
self.tabBarController!.selectedIndex = curTab

// Doesn't do anything
(self.storyboard?.instantiateViewController(withIdentifier: "SecondTabBar") as! UITabBarController).selectedIndex = curTab

// Where stb is via classes to the storyboard of UITabController also doesn't work
stb.selectedIndex = curTab

最佳答案

I have two UITabControllers. One is controllable from UIViewControllers that are nested within the scope of the first UITabController (lower in the hierarchy).

在另一个标签栏 Controller 中包含一个标签栏 Controller is not a supported configuration .

关于swift - 控制嵌套的 UITabController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53236270/

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