3

I'm trying to find a way to change the tint color of the text on my custom UIButton by using UIViewTintAdjustmentMode.

I have regular UIViews, for example, where I have their initial "tintColor" property set to a specific value, and then if I change their tintAdjustmentMode to UIViewTintAdjustmentModeDimmed, the tint color changes to a dimmed version of the original tint color. I'd like to do the same for my custom UIButton in that I'd like to change the text color using UIViewTintAdjustmentMode, but I can't get it to work. Is it possible to do this?

The difference between my button and my other UIViews is that I am actually setting the color of the text on the UIButton like so: (rather than by using the tint view which doesn't work):

[self.button setTitleColor:[ThemeHelper iconNavigationColor]forState:UIControlStateNormal];

//where [ThemeHelper iconNavigationColor] is just a custom UIColor using RGB values

Is there a way to use UIViewTintAdjustmentMode to change text color? I have tried setting the tint color on the button itself and on it's title label, but that doesn't seem to have any effect on the text color.

Someone gave a related answer in this question: UIButton Default Title Color iOS7 but the solution provided has not worked for me.

Community
  • 1
  • 1
jac300
  • 5,182
  • 14
  • 54
  • 89

0 Answers0