// 畫三角形19 143 83
UIBezierPath *path = [UIBezierPath bezierPath];
[path moveToPoint:CGPointMake(width - 25, 10)];
[path addLineToPoint:CGPointMake(width - 20, 2)];
[path addLineToPoint:CGPointMake(width - 15, 10)];
CAShapeLayer *layer = [CAShapeLayer layer];
// 顏色設置和cell顏色一樣
layer.fillColor = [UIColor redColor].CGColor;
layer.strokeColor = [UIColor blueColor].CGColor;
//? ? layer.fillColor = RGBCOLOR(19, 143, 83, 1).CGColor;
//? layer.strokeColor = RGBCOLOR(19, 143, 83, 1).CGColor;
layer.path = path.CGPath;
[self.bgView.layer addSublayer:layer];
這里的bgView是我的背景View