Quantcast
Channel: Active questions tagged react-native+ios - Stack Overflow
Viewing all articles
Browse latest Browse all 16750

UISegmentedControl iOS 13 change color of UIControlStateSelected and UIControlStateHighlighted together

$
0
0

Trying to do something like:

[self setSelectedSegmentTintColor:tintColor];
[self setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor blackColor]}
                    forState:UIControlStateSelected];
[self setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor blackColor]}
                    forState:UIControlStateSelected|UIControlStateHighlighted];
[self setTitleTextAttributes:@{NSForegroundColorAttributeName: tintColor}
                    forState:UIControlStateNormal];

But looks like I cannot do forState:UIControlStateSelected|UIControlStateHighlighted. This is how my tabs look:

enter image description here

Which is ok. But when I press the selected item, the text color changes to white (tint):

enter image description here

Any way to configure the text color for selected & highlighted?


Viewing all articles
Browse latest Browse all 16750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>