death7eater
death7eater

Reputation: 1134

How to get highlight effect from an invisible button over an imageview

I put a button over my imageview. So it is a custom button and have nothing inside of it. It is invisible. I cant change my structure so I have to put that invisible buttons on my imageview.

My question is is it possible also to having highlight effect of the button? Because when I press the button everything is ok. It is working like a charm. But as expected there is no highlight effect. How can I have it?

Upvotes: 0

Views: 311

Answers (3)

death7eater
death7eater

Reputation: 1134

I ended up by using a black over image with %50 opacity.

Upvotes: 0

Adithya
Adithya

Reputation: 4705

Try setting showsTouchWhenHighlighted of UIButton to YES. I hope this was what you were looking for.

Upvotes: 1

Apurv
Apurv

Reputation: 17186

You set the highlighted image for button by below code.

 [sender setImage:HIGHLIGHT_IMAGE forState:UIControlStateHighlighted]; 

Upvotes: 0

Related Questions