LZViewPager
LZViewPager copied to clipboard
How to change the Selected Tab Text Color.
How we can change the Selected Tab Text Color or when we swipe auto change the current tab text Color. Color must be custom. Please let me know as soon as possible.
Hi kumarlav0 You can refer to our demo project. The general code is as follows
func button(at index: Int) -> UIButton {
let button = UIButton()
button.titleLabel?.font = UIFont.systemFont(ofSize: 16)
button.setBackgroundImage(UIImage.imageWithColor(color: UIColor.lightGray), for: .normal)
button.setBackgroundImage(UIImage.imageWithColor(color: UIColor.gray), for: .selected)
button.setTitleColor(UIColor.black, for: .normal) //normal color
button.setTitleColor(UIColor.white, for: .selected) //selected color
return button
}