Why does a custom UIButton image not resize with the button?
I set its view mode to Scale to Fill in Interface Builder, but unlike a UIImageView image, it doesn't respect that setting.
Am I looking in the wrong place or is it not possible?
Why does a custom UIButton image not resize with the button?
I set its view mode to Scale to Fill in Interface Builder, but unlike a UIImageView image, it doesn't respect that setting.
Am I looking in the wrong place or is it not possible?
Remember to set Control Alignment settings for the button
Try setting the Clip subviews property in Interface Builder to true.
Hope that helps.
The best solution I found so far in Swift 2.1 is the following:
This will scale the image so it has an aspect fit in the imageView.