2

I put a UIButton on a UITableViewCell and set its showsTouchWhenHighlighted property to YES. The cell's selection style is UITableViewCellSelectionStyleNone. I have a selector that gets called when the button is tapped and it's working fine, so the button is getting the touch events fine. However, button doesn't show the highlight effect when touched.

When I put this button on a UIView, the highlight effect works.

How can I make this work when the button is placed on the cell?

aslı
  • 8,740
  • 10
  • 59
  • 80

2 Answers2

0

Are you adding the button to the cell or cell.contentView? The contentView property behaves more like a regular UIView, that might solve your problem.

Chris C
  • 3,221
  • 1
  • 27
  • 31
0

You need to set 'delaysContentTouches' to NO on the Table View

strange
  • 9,654
  • 6
  • 33
  • 47