How to disable the highlight control state of a UIButton?

This will work for you:

[button setBackgroundImage:[UIImage imageNamed:@"button_image"] forState:UIControlStateNormal];
[button setBackgroundImage:[UIImage imageNamed:@"button_image_selected"] forState:UIControlStateSelected];
[button setBackgroundImage:[UIImage imageNamed:@"button_image_selected"] forState:UIControlStateSelected | UIControlStateHighlighted];

3rd line is the trick here...

This works the same for setting image/backgroundImage


Your button must have its buttonType set to Custom.

In IB you can uncheck "Highlight adjusts image".

Programmatically you can use theButton.adjustsImageWhenHighlighted = NO;

Similar options are available for the "disabled" state as well.


adjustsImageWhenHighlighted = NO;

In addition to above answer of unchecking "highlight adjusts image" in IB, make sure that button type is set CUSTOM.