tags:

views:

551

answers:

1

I have a UIButton that's 90x90 in size and I would like it to glow when tapped. Using showsTouchWhenHighlighted will make it glow but it's glowing out of the center of the button and for a small radius only. This might work well for a small button like the info button, but for my button size, it's not. Is there anything I can do to make it glow from the outer perimeter of the button before I resort to designing a highlighted state?

A: 

I can think of 2 ways to do what you want:

  1. Use different highlighted background image for your button's highlighted state,
  2. Use CoreGraphics to draw the glow effect in your button's IBAction (touchDown is a decent place).

This is assuming you want some kind of custom glow effect of course - UIButtons already naturally have a highlighted effect when touched.

Chu Yeow