zoukankan      html  css  js  c++  java
  • 使用系统UITabbarItem自定义图片显示原本颜色和自定义文字颜色

    。。。。。。

     

    ThirdViewController *thirdVC = [[ThirdViewControlleralloc]initWithTitle:@"搜索信息"];

        //设置tabbarItem 的图片显示原图颜色;

        thirdVC.tabBarItem = [[UITabBarItemalloc]initWithTitle:@"搜索"image:[[UIImageimageNamed:@"login_usernick"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImageimageNamed:@"login_usernick_highlighted"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

        

        //一句话改变图片和文字的颜色均为红色选中时候

    //    [[UITabBar appearance]setTintColor:[UIColor redColor]];

        

    //只是设置TabBarItem的字体颜色

        [[UITabBarItemappearance] setTitleTextAttributes:[NSDictionarydictionaryWithObject:[UIColorblackColor] forKey:NSForegroundColorAttributeName] forState:UIControlStateNormal];

        [[UITabBarItemappearance] setTitleTextAttributes:[NSDictionarydictionaryWithObject:[UIColorredColor] forKey:NSForegroundColorAttributeName] forState:UIControlStateSelected];

        

        

        RootNavgationController*nav3 = [[RootNavgationControlleralloc]initWithRootViewController:thirdVC];

        NSArray *VCs= [NSArray arrayWithObjects:nav1,nav2,nav3, nil];

        tabControl.viewControllers = VCs;

        self.window.rootViewController = tabControl;

  • 相关阅读:
    关于TNS_ADMIN环境变量
    Oracle Instant Client的安装和使用
    oracle 网络访问配置tnsnames.ora文件的路径
    sql优化(2)
    sql优化(1)
    mybatis的dao的注解
    配置nginx php上传大文件
    给Linux增加swap内存
    MQ选型之RabbitMQ
    Golang并发模型之Context详解
  • 原文地址:https://www.cnblogs.com/zhujin/p/4420476.html
Copyright © 2011-2022 走看看