iOS 13设置tabbar字体颜色及大小(解决push之后再返

2020-09-29  本文已影响0人  iOS门三闫

  UITabBarItem *item = [UITabBarItem appearance];

    [item setTitleTextAttributes:@{ NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#333333"],NSFontAttributeName:[UIFont systemFontOfSize:14]} forState:UIControlStateNormal];

    [item setTitleTextAttributes:@{ NSForegroundColorAttributeName:[UIColor colorWithHexString:@"#FF0009"],NSFontAttributeName:[UIFont systemFontOfSize:14]} forState:UIControlStateSelected];

    if (@available(iOS 13.0, *)) { 

      // iOS13 及以上

        self.tabBar.tintColor = [UIColor colorWithHexString:@"#FF0009"];        self.tabBar.unselectedItemTintColor = [UIColor colorWithHexString:@"#333333"];

            }

上一篇 下一篇

猜你喜欢

热点阅读