How to set corner radius of imageView?

后端 未结 10 629
清酒与你
清酒与你 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:24

    You can define border radius of any view providing an "User defined Runtime Attributes", providing key path "layer.cornerRadius" of type string and then the value of radius you need ;) See attached images below:

    Configuring in XCode

提交回复
热议问题