Reputation: 6742
I have a button with text and image and it looks perfectly fine in IB but when I run the app the images don't scale they are wider than the canvas. How does this happen? I tried several modes like "Aspect to fill", and "Scale to Fill" but none of them does anything on the image.
Upvotes: 1
Views: 320
Reputation: 7187
Try setting
button.backgroundImage = yourImage;
instead of
button.image = yourImage;
Upvotes: 3