Search code examples
iosstoryboardswift5

Is there a way to adjust image size in a button in iOS?


As seen in the image below, the image of the button is crossing the button boundaries. Is there a way to make the image fit in the boundaries of the button either through the storyboard or programmatically?

Image


Solution

  • Change the Button Style from Plain to Default:

    enter image description here

    Here is a button constrained to 60 x 60 with a 80 x 80 image with Style: Plain:

    enter image description here

    and with Style: Default:

    enter image description here