Storyboard and autolayout: how make a circular image

前端 未结 7 706
逝去的感伤
逝去的感伤 2021-01-01 02:27

in storyboard (xcode 6) i want a circular user image profile take from Facebook.

So i have make this interface in storyboard, using auto layout:

7条回答
  •  南笙
    南笙 (楼主)
    2021-01-01 02:53

    I have made the same thing a little time ago and this worked for me

    self.imageView.image = [ImageHelper getImage]; //retrieve image
    self.imageView.layer.cornerRadius = self.imageView.frame.size.height / 2;
    self.imageView.layer.masksToBounds = YES;
    self.imageView.layer.borderWidth = 0;
    self.imageView.contentMode = UIViewContentModeScaleAspectFill;
    

提交回复
热议问题