下面的代码绘制了一个圆,我如何修改现有的代码来绘制一个三角形呢?绘制三角形iOS
_colorDotLayer = [CALayer layer];
CGFloat width = self.bounds.size.width-6;
_colorDotLayer.bounds = CGRectMake(0, 0, width, width);
_colorDotLayer.allowsGroupOpacity = YES;
_colorDotLayer.backgroundColor = self.annotationColor.CGColor;
_colorDotLayer.cornerRadius = width/2;
_colorDotLayer.position = CGPointMake(self.bounds.size.width/2, self.bounds.size.height/2);
此方法对绘制三角形没有用处。你应该看看UIBezierPath来做到这一点。 – rdelmar 2014-08-30 01:19:49
你也应该看看CGContext。 – user2548635 2014-08-30 01:22:58
SO不是代码翻译服务。 – Abizern 2014-08-30 14:54:14