Mujtaba Alboori
Mujtaba Alboori

Reputation: 395

how to disable highlight for UIButton when the user click on

I'm doing a UIButtion that highlight once it clicked and it is un-highlighted when it's clicked again. I can not get to un-highlight when I click on. I have made an event listener below

  • (IBAction)ButtonClicked:(UIButton*)sender
    {

    [sender setHighlighted:!sender.isHighlighted];
    

    }

Edit: and the target action is

 [button addTarget:self action:@selector(ButtonClicked:) forControlEvents:UIControlStateSelected];

Upvotes: 0

Views: 1514

Answers (1)

Adrian Ancuta
Adrian Ancuta

Reputation: 1036

[sender setSelected:!sender.isSelected] try this:) If this is what you want

Upvotes: 1

Related Questions