码迷,mamicode.com
首页 > 其他好文 > 详细

UITabBarController 更改tabbariteam上的选中图片

时间:2016-08-02 20:34:12      阅读:167      评论:0      收藏:0      [点我收藏+]

标签:

 

首先遵守“ UITabBarControllerDelegate ”协议

再在- (void)viewDidLoad {}方法中设置代理“ self.tabBarController.delegate = self; ”

最后执行代理方法

-(void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{
    if (_sdCycleScrView.hidden == YES) {
        switch (tabBarController.selectedIndex) {
            case 0:
            {
                UINavigationController *nav = tabBarController.viewControllers[0];
                if (inputview.hidden == YES) {
                    inputview.hidden = NO;
                    nav.tabBarItem.selectedImage = [[UIImage imageNamed:@"call_2@2x"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
                }else{
                    inputview.hidden = YES;
                    nav.tabBarItem.selectedImage = [[UIImage imageNamed:@"call_3@2x"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
                }
            }
                break;
            default:
                break;
        }
    }
}

UITabBarController 更改tabbariteam上的选中图片

标签:

原文地址:http://www.cnblogs.com/linzhengbo/p/5730331.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!