I\'m trying to create a custom UITableViewCell programmatically and one of the subviews of this cell is going to be a button with an image in it (a simple image of a magnify
Make sure the button is a Custom UIButton
Just using setImage: did not work for me on iOS9.
setImage:
But it worked combined with myButton.imageView.contentMode = UIViewContentMode.ScaleAspectFit;
myButton.imageView.contentMode = UIViewContentMode.ScaleAspectFit;