标签:
let layer = CAShapeLayer()
layer.frame = CGRectMake(110, 100, 150, 100)
layer.backgroundColor = UIColor.blackColor().CGColor
view.layer.addSublayer(layer)
CAShapeLayer 画图时的动画改变
strokeEnd、strokeStart和lineWidth 三个属性,可以控制划线时具有动画效果。
layer.fillColor = UIColor.clearColor().
CGColor
layer.strokeColor = UIColor.blackColor().CGColor
2.2、CAShapeLayer 和
UIBezierPath配合划取线let path = UIBezierPath(arcCenter: view.center, radius: radius, startAngle: startAngle, endAngle: endAngle, clockwise:
true
)
let layer = CAShapeLayer()
layer.path = path.CGPath
layer.fillColor = UIColor.clearColor().CGColor
layer.strokeColor = UIColor.blackColor().CGColor
UIBezierPath和CAShapeLayer配合肆意画图
标签:
原文地址:http://www.cnblogs.com/hepingqingfeng/p/5445792.html