问题描述:
just found out something: If you have a Tabbar combined with a NavigationController (that has some views on it's stack) and you double click the TabBarItem, the view pops to the first ViewController, whether you like it or not.
解决办法:
1.支持协议
2.给
UITabBarControllerDelegate
设置代理
3.实现代理方法:
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController
{
UIViewController *selected = [tabBarController selectedViewController];
if ([selected isEqual:viewController])
{
return NO;
}
return YES;
}