zoukankan      html  css  js  c++  java
  • 自带TabBar选中图片设置问题

     

     

    设置为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;

        });

  • 相关阅读:
    常用模块——time模块,datetime模块
    开发目录的规范

    模块
    day17作业
    面向过程编程
    函数递归
    谈谈作为一个菜B的培训感受
    絮叨机房精密空调的制冷剂
    接入机房产生冷凝水
  • 原文地址:https://www.cnblogs.com/XHShare/p/4878473.html
Copyright © 2011-2022 走看看