FluidBottomNavigation-ios icon indicating copy to clipboard operation
FluidBottomNavigation-ios copied to clipboard

highlightImageColor not working plz explain ho wit works

Open manasclix opened this issue 6 years ago • 2 comments

manasclix avatar Oct 18 '19 05:10 manasclix

I have the same problem please help me

Mh-ghadamyari avatar Aug 10 '20 08:08 Mh-ghadamyari

It looks like the highlightImageColor gets overridden by the tintColor.

I got this to work by creating my own FluidTabBarItemContentView subclass as follows.

class CustomContentView: FluidTabBarItemContentView{

    private let customHighlightColor: UIColor = .red
    private let customNormalColor: UIColor = .yellow

    override func updateDisplay() {
        super.updateDisplay()
        imageView.tintColor = selected ? customHighlightColor : customNormalColor
    }
}

Then I simply passed the above subclass into the FluidTabBarItem constructor as follows.

let customCV = CustomContentView()
let homeItem = FluidTabBarItem(customCV, title: "Home", image: homeIcon, tag: 0)

I got the result I want using this workaround but it will be better if the author gave a permanent fix :)

Thisura98 avatar Dec 09 '20 11:12 Thisura98