Closed ShenYj closed 3 years ago
@ShenYj hey, please take a look at RAMItemAnimation it has @IBInspectable open var textSelectedColor: UIColor @IBInspectable open var iconSelectedColor: UIColor
To update unselected state you can use RAMAnimatedTabBarItem @IBInspectable open var textColor: UIColor @IBInspectable open var iconColor: UIColor
Hope this would help you 🤞🏻 If not you can provide source code with your examples
hey, please take a look at RAMItemAnimation it has @IBInspectable open var textSelectedColor: UIColor @IBInspectable open var iconSelectedColor: UIColor
thks for your reply.
I use it in my project without xib/storyboard, Now it had been fixed!
here is my code:
internal class MainTabController: RAMAnimatedTabBarController {
override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
// fix: The first item label tintColor is wrong after changed the selected item ( 切换到TabBar控制器后, 默认首个子标签高亮色错误)
addAllChildsControllors()
super.viewDidLoad()
tabBar.tintColor = UIColor.highLightColor()
view.backgroundColor = UIColor.viewBackgroundColor()
}
}
I have two demo target:
now, the first demo is correct, but the second demo with the bug that the first tabBarItem's text selectedColor is the default blue!
I try to set up the rootViewController with custom UITabBarController directly, but it was not work!
I have to set tabBar's tintColor before set the child controllers, and the first demo I have nothing to do , but it work well!