1 UIKit性能
离屏渲染
1 设置阴影效果 会导致: 解决办法:粗线
imgView.layer.shadowColor = UIColor.blackColor().CGColor
imgView.layer.shadowOpacity = 1
imgView.layer.shadowRadius = 2
imgView.layer.shadowOffset = CGSizeMake(1, 1)
imgView.layer.shadowPath = UIBezierPath(rect: imgView.bounds).CGPath
2 设置圆角 可以使用光栅化技术将圆角缓存起来:
label.layer.masksToBounds = true
label.layer.cornerRadius = 8
label.layer.shouldRasterize = true
label.layer.rasterizationScale = layer.contentsScale
网友评论