首页 > 其他 > 详细

自带TabBar选中图片设置问题

时间:2015-10-14 21:25:20      阅读:236      评论:0      收藏:0      [点我收藏+]

 

 

设置为UIImageRenderingModeAlwaysOriginal 

就会显示出选中状态的图片。当然普通状态的也需要设置。

 UINavigationController *nav =({

        

        UINavigationController *controller = [[UINavigationController alloc]initWithRootViewController:rootVC];

        [controller.tabBarItem setTitle:title];

        UIImage *selectImage = ({

            UIImage *image = [UIImage imageNamed:selectString];

    UIImageRenderingModeAutomatic,          // Use the default rendering mode for the context where the image is used

    UIImageRenderingModeAlwaysOriginal,     // Always draw the original image, without treating it as a template

    UIImageRenderingModeAlwaysTemplate,     // Always draw the image as a template image, ignoring its color 

            image = [image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];

            image;

        });

        [controller.tabBarItem setSelectedImage:selectImage];

        [controller.tabBarItem setImage:[UIImage imageNamed:normalString]];

        controller;

    });

自带TabBar选中图片设置问题

原文:http://www.cnblogs.com/XHShare/p/4878473.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!