UITabBarItem 颜色,字体大小修改
2018-07-01 本文已影响0人
自弹自唱
letattrsNormal:[NSAttributedStringKey:Any] = [
.strokeColor : UIColor.black,
.foregroundColor : UIColor.black,
.font:UIFont.systemFont(ofSize:20)
]
letattrsSelected:[NSAttributedStringKey:Any] = [
.strokeColor : UIColor.red,
.foregroundColor : UIColor.red,
.font:UIFont.systemFont(ofSize:20)
]
UITabBarItem.appearance().setTitleTextAttributes(attrsNormal as [NSAttributedStringKey : Any], for: .normal)
UITabBarItem.appearance().setTitleTextAttributes(attrsSelected as [NSAttributedStringKey : Any], for: .selected)