I created a UIButton instance named \"button\" with an image using [UIButton setImage:forState:]
. The button.frame is larger than the image\'s size.
Now
From small test I just did after reading here, depends if you use setImage or setBackgroundImage, both did the same result and strech the image
//for setBackgroundImage
self.imageButton.contentMode = UIViewContentModeScaleAspectFill;
[self.imageButton setBackgroundImage:[UIImage imageNamed:@"imgFileName"] forState:UIControlStateNormal];
//for setImage
self.imageButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentFill;
self.imageButton.contentVerticalAlignment = UIControlContentVerticalAlignmentFill;
[self.imageButton setImage:[UIImage imageNamed:@"imgFileName"] forState:UIControlStateNormal];