如标题所述,如何在标签栏 Controller 以编程方式隐藏/显示标签栏中的标签?
或者是否有更好的方法来执行此操作,因为我想根据登录的用户显示包含特定 View 的特定选项卡。
最佳答案
假设你有一个 UITabBarController 的子类:
final class YourSubClass: UITabBarController {
override func viewDidLoad() {
super.viewDidLoad()
viewControllers?.remove(at: 0) // remove the first tab, tab index starts with 0
}
}
关于ios - 在 iOS (Swift) 的标签栏中隐藏标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38242902/