The various states: UIControlStateNormal
, UIControlStateSelected
, and (UIControlStateSelected | UIControlStateHighlighted)
are all actually distinct. If you want your shadowImage
to apply both in the (only) highlighted state and in the highlighted+selected state, you must also set:
[button setBackgroundImage:shadowImage forState:(UIControlStateHighlighted | UIControlStateSelected)]