Closed Timonator1606 closed 3 years ago
Same here
You need to change the class with this
image?.withRenderingMode(.alwaysTemplate)
UIColor.white.set()
or the color that you want
private func image(with image: UIImage?, scaledTo newSize: CGSize) -> UIImage? {
image?.withRenderingMode(.alwaysTemplate)
UIGraphicsBeginImageContextWithOptions(newSize, _: false, _: 0.0)
UIColor.white.set()
image?.draw(in: CGRect(x: 0, y: 0, width: newSize.width, height: newSize.height))
let newImage: UIImage? = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext()
return newImage
}
Thx Carlos, but this is not working. As you can see in the pics the color is still the same. In the one pic I tried color "red" and in the other one "white". It's still the same dark gray.
Guys, I got it.
Just put this:
tabBar.unselectedItemTintColor = .white
directly under:
tabBar.select(itemAt: index, animated: true)
in the first open override var selectedViewController: UIViewController? { ...
in SHCircleBarController.swift in the Pods file.
The beginning of SHCircleBarController.swift should look like this:
`fileprivate var shouldSelectOnTabBar = true private var circleView : UIView! private var circleImageView: UIImageView! open override var selectedViewController: UIViewController? { willSet { guard shouldSelectOnTabBar, let newValue = newValue else { shouldSelectOnTabBar = true return }
guard let tabBar = tabBar as? SHCircleBar, let index = viewControllers?.firstIndex(of: newValue) else {return}
tabBar.select(itemAt: index, animated: true)
tabBar.unselectedItemTintColor = .white
}`
Have a nice day.
Thx Carlos, but this is not working. As you can see in the pics the color is still the same. In the one pic I tried color "red" and in the other one "white". It's still the same dark gray.
to change the color of the image you need
image?.withRenderingMode(.alwaysTemplate)
or en assets on selected images you can change Render As: template image
And try this to unselect Item
Chicos, lo tengo.
Solo pon esto:
tabBar.unselectedItemTintColor = .white
directamente debajo de:
tabBar.select(itemAt: index, animated: true)
en el primero
open override var selectedViewController: UIViewController? { ...
en SHCircleBarController.swift en el archivo Pods.El comienzo de SHCircleBarController.swift debería verse así:
`fileprivate var shouldSelectOnTabBar = true private var circleView: UIView! private var circleImageView: UIImageView! abrir override var selectedViewController: UIViewController? { willSet { guard shouldSelectOnTabBar, let newValue = newValue else { shouldSelectOnTabBar = true return }
guard let tabBar = tabBar as? SHCircleBar, let index = viewControllers?.firstIndex(of: newValue) else {return} tabBar.select(itemAt: index, animated: true) tabBar.unselectedItemTintColor = .white }`
Que tengas un buen día.
Is it possible to change the TintColor of the unselected Tabbar Icons? The only thing I get worked is to change the background colors and the color of the selected Icon.