LZViewPager icon indicating copy to clipboard operation
LZViewPager copied to clipboard

How to change the Selected Tab Text Color.

Open kumarlav0 opened this issue 5 years ago • 1 comments

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.

kumarlav0 avatar Oct 21 '20 07:10 kumarlav0

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
   }

ladmini avatar Oct 21 '20 14:10 ladmini