View Full Version : setTitleColor For UISegmentedControl?
Darkroom
Jul 21, 2009, 04:50 PM
is this possible? i'd like the selected segment to have white text, while the non selected segments have gray text.
there only appears setTitle:forSegmentAtIndex: in the docs,and writing the following doesn't work:
[self.mySegment setTitleColor:[UIColor greenColor] forState:UIControlStateNormal];
dejo
Jul 21, 2009, 05:16 PM
is this possible?
No, not with the UISegmentedControl's API. There are workarounds, though messy, such as using setImage:forSegmentAtIndex:
Darkroom
Jul 21, 2009, 05:21 PM
No, not with the UISegmentedControl's API. There are workarounds, though messy, such as using setImage:forSegmentAtIndex:
oh that's too bad, especially since i always though the selected segment should be the light blue instead of the dark blue (default without tint), or at least the non selected text should appear darker by default...
setImage wouldn't work with localization, well... it could but... i think i'll stick to the all white text instead of creating 50 different images in Illustrator.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.