views:

308

answers:

0

I'm using a UISegmentedControl 2 times in my app. Both use the following settings...

[segmentedControl setSegmentedControlStyle:UISegmentedControlStyleBar];
[segmentedControl setTintColor:[UIColor darkGrayColor]];

The 1st appears on a navigation bar and works as expected, i.e. the selected control displays white text and the other control has a faded background with gray text color.

The 2nd appears on a UIView above a tableviewcontroller and doesn't work as expected. The selected control is fine and appears with white text. However, the other control, although faded background, still shows white text as opposed to the gray text that appears when attached to the navigation bar.

These 2 segmented controls do not appear in the same navigation controllers/views so there is no conflict there...

My code is the same for both controls so I don't think it has anything to do with how I've configured it. I'm thinking once it is attached to a navigation bar it inherits some additional properties that are not inherited on the UIView.

Any ideas on why this could be happening or how to go around fixing it?

Cheers,