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

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

作者: iOS门三闫 | 来源:发表于2020-09-29 13:34 被阅读0次

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

                }

    相关文章

      网友评论

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

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