- 设置文字颜色
viewController.tabBarItem.setTitleTextAttributes([NSForegroundColorAttributeName: UIColor.orange], for: UIControlState.selected)
2.去除图片的渲染颜色
viewController.tabBarItem.selectedImage = viewController.tabBarItem.selectedImage?.withRenderingMode(UIImageRenderingMode.alwaysOriginal)
网友评论