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)
网友评论