I’m trying to make a UIButton with a background image where the image is larger than the button frame.
The problem is, the UIButton automatically scales the image to fit and haven’t found a way to change the behavior.
Am I missing something obvious or is it time to make a custom button?
Looks like the answer to this one is. Not possible through existing interface on
UIButton.The simplest way to implement seems to be using a custom sub class of
UIButtonand creating aUIImageViewwith the same frame as theUIButton, turn off clipping and scaling and then just capture all thesetBackgroundmethods and capture state changes to handle “normal” button interaction changing the background images.