0

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

Jawad Ali
  • 13,556
  • 3
  • 32
  • 49
mostlyAsking7179
  • 204
  • 2
  • 11

2 Answers2

2

Set buttons clip to bounds true

button.clipsToBounds = true
Jawad Ali
  • 13,556
  • 3
  • 32
  • 49
1

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

Heeba Khan
  • 92
  • 1
  • 5