iOS开发学习-给圆形图片添加边框

        imageView.layer.cornerRadius = imageView.bounds.size.width * 0.5;// 设置圆角刚好是自身宽度的一半,就刚好是圆形

        imageView.layer.masksToBounds = YES;

        imageView.layer.borderWidth = 1; //边框宽度

        imageView.layer.borderColor = [[UIColor grayColor] CGColor];//边框颜色

原文地址:https://www.cnblogs.com/KevinBin/p/5626378.html