Prevent UIButton.imageView from resizing by image
问题 I have a UIButton with a fixed height of 40 (constraint height of 40) where I set an image via code thats an pdf (vectorgraphic) of size 64x64 . The result should be: I have added the image like the following: image = [UIImage imageNamed:@"icon-clear"]; [self setImage:image forState:UIControlStateNormal]; The result I'm getting is: Added a black border to the imageView for better visualisation. The imageView has a final size of 64x40 . The thing that happen, I guess, is that the imageView