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.
我有一个 TabBar,有几个项目,代表一个视图,现在,当我通过其中一个项目加载视图时,我想取消设置 TabBar,而不是删除它,而是将其设置为未选择项目。
TabBar 控制器是通过故事板制作和初始化的,我假设我需要获取它的实例来执行此操作,我将如何执行此操作?
Try this code:
self.tabBarController.selectedViewController = nil;
you should just put the same image for both status selected and normal... if you unselect the selection you won't be able to show the view