在iOS7以上可以用系统自带的消除锯齿
方法一 : layer.allowsEdgeAntialiasing = true
方法二 :layer.shadowOffset = CGSize(width: 0, height: 2)
layer.shadowRadius = 2.0
layer.shadowColor = UIColor.white.cgColor
layer.shadowOpacity = 0.8
layer.borderColor = UIColor.clear.cgColor
layer.borderWidth = 2.0
网友评论