zoukankan      html  css  js  c++  java
  • UITabBar 设置字体的颜色(选中状态/正常状态)setTitleTextAttributes

    UITabbar有个setTintColor这个方法,可以理解为,高亮的时候,或者点击后的颜色设置。


    UITabBarItem有个setTitleTextAttributes的方法,是用来设置字体的颜色。

    [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:

                                                           [UIColor redColor], NSForegroundColorAttributeName,

                                                           nil] forState:UIControlStateNormal];

        UIColor *titleHighlightedColor = [UIColor greenColor];

        [[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:

                                                           titleHighlightedColor, NSForegroundColorAttributeName,

                                                           nil] forState:UIControlStateSelected];

  • 相关阅读:
    php 全局变量 2
    PHP 全局变量 1
    巧用sublime
    ini_get和ini_set
    sublime安装sftp
    常用数组函数
    二维数组去重
    判断常量
    system(),exec() ,passthru()
    【收集】Python 微优化
  • 原文地址:https://www.cnblogs.com/lrr0618/p/5203093.html
Copyright © 2011-2022 走看看