标签:
// 自定义各个顶角的圆角
/// 头像
iconView = UIImageView()
iconView.frame.size = CGSizeMake(Consts.WIDTH - 10, 170 * Consts.RATE)
contentView.addSubview(iconView)
let maskPath = UIBezierPath(roundedRect: iconView.bounds, byRoundingCorners: [UIRectCorner.TopLeft,UIRectCorner.TopRight], cornerRadii: CGSize(width: 10, height: 10))
let maskLayer = CAShapeLayer()
maskLayer.frame = iconView.bounds
maskLayer.path = maskPath.CGPath
iconView.layer.mask = maskLayer
///UIRectCorner.xxx 用来设置矩形视图某个角为圆角
标签:
原文地址:http://www.cnblogs.com/madarax/p/5474648.html