mostlyAsking7179
mostlyAsking7179

Reputation: 204

Why does a selected image overflow the button border in swift?

enter image description here

I am trying to create a profile image selection button. However, every time I select an image with UIImagePickerController, the image overflows the bottom of the button border. Is there a way to make sure the image stays within the border

Upvotes: 0

Views: 339

Answers (2)

Heeba Khan
Heeba Khan

Reputation: 102

Select clipToBounds from attributes section, or add button.clipsToBounds = true . Try using Autofit as well. it is also available in attribute section on storyboard.

Upvotes: 1

Jawad Ali
Jawad Ali

Reputation: 14397

Set buttons clip to bounds true

button.clipsToBounds = true

Upvotes: 2

Related Questions