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];

相关文章:

  • 2021-11-19
  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
  • 2021-09-08
  • 2021-05-16
猜你喜欢
  • 2021-12-28
  • 2022-12-23
  • 2022-02-09
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2022-02-09
相关资源
相似解决方案