The width(40) and height(40) of the UIView are equal.
I have tried these but they didn't work for me:
countView?.clipsToBounds = true
self.countView?.layer.cornerRadius = min((countView?.frame.size.width)!, (countView?.frame.size.height)!)/2
and also
self.countView.layer.cornerRadius = (countView.frame.size.width)/2
Thanks
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.