UISegmentedControl color

75 views
Skip to first unread message

Eric Chan

unread,
Jun 2, 2009, 4:24:38 PM6/2/09
to RTFM: Development for Mobile Devices
Does anyone know how to change the color of the selected segments?
(and maybe even the color of the unselected ones). I tried
setTintColor but that did not do the trick.

DavidK

unread,
Jun 2, 2009, 4:34:21 PM6/2/09
to RTFM: Development for Mobile Devices
[seg setSegmentedControlStyle:UISegmentedControlStyleBar];
[seg setTintColor:[UIColor blackColor]];
will change the color of all of them, I'm not sure you have any
control over the selected segment, I think it just darkens the
original color.

Eric Chan

unread,
Jun 2, 2009, 6:38:32 PM6/2/09
to RTFM: Development for Mobile Devices
That worked, I just forgot to set the control style to Bar (was using
Plain).
The selected segment just becomes a darker shade of the color that
I've set for the tint.

Thanks!
Reply all
Reply to author
Forward
0 new messages