Ios – How to disable UIButton highlight on click

iosobjective cuibutton

How to disable button highlight effect on click? Have custom button with white bg color and DarkGray text color. The problem is the text becomes white on button click. Already tried but none of them worked:

a. Did uncheck "Highlighted Ajusts Image" in interface builder.

b. Tried setting highlighted = NO in button pressed method:

((UIButton *)sender).highlighted = NO

c. Tried setting the same title for highlihted state:

[button setTitle:[button titleForState:UIControlStateNormal] forState:UIControlStateHighlighted];

Any suggestions?

Best Answer

You could also make the UIButton type : custom from StoryBoard

Custom button

This should strip down any system behavior for you. (I think)