Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone: UIButton don't use default pressed highlight

Currently when you use a UIButton and press down on it, it gives the button a dark overlay as an indicator that the button was pressed. I don't want this as I am implementing my own pressed state.

How can I remove this default?

like image 465
Nic Hubbard Avatar asked Sep 08 '10 21:09

Nic Hubbard


2 Answers

You could also set the appropriate property:

button.adjustsImageWhenHighlighted = NO;
like image 174
Buzzwig Avatar answered Sep 23 '22 08:09

Buzzwig


You should be able to set it by setting the image for the control state. Think its

[button setBackgroundImage:[UIImage imageNamed:@"Selected_day.png"] forState:UIControlStateHighlighted];
like image 26
Rudiger Avatar answered Sep 22 '22 08:09

Rudiger