gpt4 book ai didi

ios - 以模态方式呈现 ViewController 时如何禁用所有 UITabBarItems?

转载 作者:行者123 更新时间:2023-11-28 23:57:54 25 4
gpt4 key购买 nike

我已经在我的应用中实现了 UITabBar。在一个 UITabBar 项目的 ViewController 内部,我展示了另一个 模态呈现 的 ViewController。在此阶段,我想禁用所有 UITabBar 项目并在 willdisappear 中重新启用。

Inside the following delegate, if I get the presented modally ViewController then, on comparing I can return without any action. But I'm confused on how to get visible ViewController which is presented modally. Will this approach works?

 (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{
//HOW CAN I GET HERE VISIBLE VIEWCONTROLLER I.E. PRESENTED MODALLY VIEWCONTROLLER.
}

最佳答案

禁用:

self.tabBarController.tabBar.userInteractionEnabled = NO;

启用

self.tabBarController.tabBar.userInteractionEnabled = YES;

关于ios - 以模态方式呈现 ViewController 时如何禁用所有 UITabBarItems?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50598773/

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