0

Hierarchy of views:

  1. UIImageView cropped circular:

Constraints: Width, Height, Top Layout Guide vertical space, Align X to SuperView, Align X to Camera Button

  1. Camera Button:

Constraints:Width, Height, Top space ImageView,Align center X to ImageView.

Trying this crops the image like this enter image description here

Please advice to avoid this.

TechSavy
  • 797
  • 2
  • 8
  • 22

1 Answers1

0

Your constraints should be like :

ImageView : horizontally in container, Vertically in container, fixed width, fixed height

Button : horizontally in container(align center x) and top. If required then fixed height and width (this only need when button is not default means custom button other wise two constraints is enough - horizontal in container and top)

Then in your viewDidload set cornerradius of your imageview something like,

   self.imageViewProfile.layer.cornerRadius = 26.5; //corner radius should be exact half of your imageView's height
   self.imageViewProfile.layer.masksToBounds = YES;

Hope this will help :)

Ketan Parmar
  • 27,092
  • 9
  • 50
  • 75