美文网首页
设置UITabBarItem样式

设置UITabBarItem样式

作者: 绍清_shao | 来源:发表于2019-08-10 20:56 被阅读0次

设置UITabBarItem文字颜色

// 常态颜色
UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.gray], for: .normal)
        
// 选择颜色   UITabBarItem.appearance().setTitleTextAttributes([NSAttributedString.Key.foregroundColor: UIColor.red], for: .selected)

同时修改UITabBarItem文字与图片

self.tabBar.tintColor = UIColor.orange

相关文章

网友评论

      本文标题:设置UITabBarItem样式

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