#pragma mark -
#pragma mark UITabBarControllerDelegate
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:
(UIViewController *)viewController{
[self setNoHighlightTabBar];//选中时调用
}
- (void)setNoHighlightTabBar
{
NSArray * tabBarSubviews = [self.tabBarController.tabBar subviews];
for(UIView *sub in tabBarSubviews)
{
for(UIView * insub in [sub subviews])
{
if(insub && [NSStringFromClass([insub class]) isEqualToString:@"UITabBarSelectionIndicatorView"])//选中图片对于的view
{
[insub removeFromSuperview];
break;
}
}
}
}
#pragma mark UITabBarControllerDelegate
- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:
(UIViewController *)viewController{
[self setNoHighlightTabBar];//选中时调用
}
- (void)setNoHighlightTabBar
{
NSArray * tabBarSubviews = [self.tabBarController.tabBar subviews];
for(UIView *sub in tabBarSubviews)
{
for(UIView * insub in [sub subviews])
{
if(insub && [NSStringFromClass([insub class]) isEqualToString:@"UITabBarSelectionIndicatorView"])//选中图片对于的view
{
[insub removeFromSuperview];
break;
}
}
}
}