美文网首页
UITabBar文字设置颜色

UITabBar文字设置颜色

作者: Johnson_9d92 | 来源:发表于2021-12-11 20:16 被阅读0次

UITabBar文字设置颜色

UITabBarItem *item = [UITabBarItem appearance];
     [item setTitleTextAttributes:@{
        NSFontAttributeName: [UIFont systemFontOfSize:14],
        NSForegroundColorAttributeName: [UIColor grayColor]
     } forState:UIControlStateNormal];
    [item setTitleTextAttributes:@{
        NSForegroundColorAttributeName: [UIColor redColor]
     } forState:UIControlStateSelected];
    self.tabBar.tintColor = UIColor.redColor;

相关文章

网友评论

      本文标题:UITabBar文字设置颜色

      本文链接:https://www.haomeiwen.com/subject/orclfrtx.html