iOS 画一个扇形不是从顶点
CAShapeLayer *layer = [[CAShapeLayeralloc]init];
UIBezierPath \*originPath = \[UIBezierPathbezierPath\];
//起始中心点改一下
\[originPath moveToPoint:CGPointMake(200,200)\];
//顺和逆交叉的相互抵消
\[originPath addArcWithCenter:CGPointMake(200,200)radius:40startAngle:M\_PI\_2endAngle:M\_PIclockwise:NO\];
\[originPath addArcWithCenter:CGPointMake(200,200)radius:10startAngle:M\_PIendAngle:M\_PI\_2clockwise:YES\];
\[originPath closePath\];
layer.fillColor = \[UIColorredColor\].CGColor;//填充颜色
layer.path = originPath.CGPath;
\[self.view.layeraddSublayer:layer\];
![Image 1][]
![Image 1][]
[Image 1]:
还没有评论,来说两句吧...