How to set corner radius of imageView?

后端 未结 10 686
清酒与你
清酒与你 2020-12-13 01:50

In Objective-C such line

self.mainImageView.layer.cornerRadius = CGRectGetWidth(self.mainImageView.frame)/4.0f;

does its job, I tried it in

10条回答
  •  渐次进展
    2020-12-13 02:33

    in swift 3 'CGRectGetWidth' has been replaced by property 'CGRect.width'

        view.layer.cornerRadius = view.frame.width/4.0
        view.clipsToBounds = true
    

提交回复
热议问题