I have emojis used in the different segments for my Segmented Control. When I select a segment, the selected segment highlights (indicates which one was selected), and the emoji suddenly becomes all white. Is there anyway to fix this issue? Thanks!
I use follow code and it worked for me.
OC:
[segmentedControl setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor whiteColor]} forState:UIControlStateSelected];
Swift:
let segmentedControl = UISegmentedControl(items: ["๐","๐ข","moon"])
segmentedControl.setTitleTextAttributes([NSForegroundColorAttributeName:UIColor.whiteColor()], forState:.Selected)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With