How to set image in circle in swift

前端 未结 14 1732
星月不相逢
星月不相逢 2020-12-04 09:55

How can i make i circle picture with swift ?

My ViewController :

import UIKit
import Foundation

class FriendsViewController : UIViewController{

            


        
14条回答
  •  不思量自难忘°
    2020-12-04 10:20

    If you mean you want to make a UIImageView circular in Swift you can just use this code:

    imageView.layer.cornerRadius = imageView.frame.height / 2
    imageView.clipsToBounds = true
    

提交回复
热议问题