UITabBar图标上一个选中

时间:2016-01-05 19:35:10

标签: ios objective-c uitabbar uicolor

我正在使用自定义颜色在我的应用中显示

我需要使用三种颜色:

  1. 背景 - 某种白色
  2. 未选中的图标 - 某种黑色
  3. 所选图标 - 紫色
  4. 不幸的是,不知何故,当我选择一个图标然后选择另一个图标时,前一个图标会返回系统着色(在附加图像中以红色圈出)。

    作为着色的一部分,我写了以下代码:

      //uitabbar background
    [[UITabBar appearance] setTintColor:[UIColor Primary]];
    
    // selected icon tint color
    [[UITabBar appearance] setBarTintColor:[UIColor Scondary]];
    
    // unselected icon tint color
    [[UIView appearanceWhenContainedIn:[UITabBar class], nil] setTintColor:[UIColor Base]];
    

    enter image description here

0 个答案:

没有答案