Search code examples
iosxamarinuibuttontouchhighlight

How can I change the UIButton "glow" color used when "Shows Touch On Highlight" is enabled?


I have a UIButton with "Shows Touch On Highlight" enabled in the storyboard. It applies a "white" glow to the button when clicked.

However, I have a light grey button and would like to change the glow color so that it's more visible.

I've tried setting the background image for the highlighted control state to black, but it doesn't seem to make a different to the glow. I can change the background color of the button---that all works.

What controls the glow color, if anything? Or do I have to do it manually if I need a different color?


Solution

  • "Shows Touch On Highlight" is a pure convenience, so you do have to do things manually if you want a different effect. Just supply a different image for the highlighted state, one that includes the desired "glow" drawing.