Reputation: 27
I have some problem with segmented control. I can't change the tint color, what ever color I set for the tint, segmented control is always gray as you can see on the picture. Below is the code I'm using, changing the color of the button works.
UIColor *newTintColor = [UIColor colorWithRed:(30.0f/255.0f) green:(98.0f/255.0f) blue:(134.0f/255.0f) alpha:1.0f];
[btnLogin setBackgroundColor:newTintColor];
[btnLogin setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[rememberMe setTintColor:newTintColor];
I forgot one thing, on application start segmented control has newTintColor, after login in application is displayed new view (split view), when user clicks on settings button, view for settings is displayed. Settings view has one segmented control for which I also can't change tint color (it is always gray) and logout button, if user clicks on logout button login view is displayed again and segmented control has gray tint instead of newTintColor.
Upvotes: 0
Views: 611
Reputation: 535306
The gray color is a clue: it suggests that this view's tint adjustment mode has at some point been set to UIViewTintAdjustmentModeDimmed
and then has never been set back to Automatic
. See the docs on UIViewTintAdjustmentMode
:
Upvotes: 3