简体   繁体   English

以编程方式更改selectedViewController或selectedIndex后,iOS7 UITabBarController不响应

[英]iOS7 UITabBarController not responding after programmatically changing selectedViewController or selectedIndex

As stated above I'm having problems regarding UITabBarController or specifically the tab bar not responding after manually/programmatically setting the selectedViewController or selectedIndex. 如上所述,我遇到关于UITabBarController的问题,或者特别是选项卡栏在手动/编程设置selectedViewController或selectedIndex之后没有响应。 This also happens when I pop the view controller of the previously selected tab before moving to another tab screen. 当我在移动到另一个选项卡屏幕之前弹出先前选择的选项卡的视图控制器时,也会发生这种情况。 Yes I believe I have checked the multiple times the delegate for UITabBarController and yes I have confirmed that the 是的,我相信我已经多次检查了UITabBarController的委托,是的,我已经确认

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController

is not being fired. 没有被解雇。 Is there anyone who has experienced this? 有没有人经历过这个?

确保设置委托权限,否则,将不会触发委托方法。

Seems like loading behavior of assets might have changed in iOS7 似乎资产的加载行为在iOS7中可能已更改

Make sure that the view is completely loaded. 确保视图已完全加载。

Prior to iOS7, you would create the tabbed view, push it, then select the tab. 在iOS7之前,您需要创建选项卡式视图,将其推入,然后选择选项卡。

in ios7, the view is not loaded synchronously. 在ios7中,视图不会同步加载。 So while you did create it and display it, the select index gets called before it is actually shown and therefore has no effect. 因此,尽管确实创建并显示了它,但是选择索引在实际显示之前就被调用了,因此无效。

At least this is what bit me as we have started to transition to iOS7 至少在我们开始过渡到iOS7的过程中,这一点让我感到困扰

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM