标签:
x y z 分别是尖角的三个顶点的x坐标,从左到右排列 后面的[UIScreen mainScreen].bounds.size.height -65 是y坐标 与x坐标一一对应
- (void)shapeChange:(int)x Pointy:(int)y Pointz:(int)z{
/*形状*/
self.shapeLayer = [CAShapeLayer layer];
//self.shapeLayer.strokeColor = [UIColor greenColor].CGColor;
self.shapeLayer.fillColor = [UIColor whiteColor].CGColor;
self.shapeLayer.lineWidth = 1;
/*路径*/
CGMutablePathRef path = CGPathCreateMutable();
CGPathMoveToPoint(path, NULL,x ,[UIScreen mainScreen].bounds.size.height -65);
CGPathAddLineToPoint(path, NULL, y, [UIScreen mainScreen].bounds.size.height -53);
CGPathAddLineToPoint(path, NULL, z, [UIScreen mainScreen].bounds.size.height -65);
self.shapeLayer.path = path;
self.shapeLayer.frame = self.heatab
.view.bounds;
[self.bgview.layer addSublayer:self.shapeLayer];
}
标签:
原文地址:http://www.cnblogs.com/Jusive/p/5800354.html