내가 정의 CALayer
클래스의 drawLayer 방법으로 호를 그리 아래의 코드를 사용하고 있지만 아무것도 표시되지 않습니다의 CALayer drawLayer inContext에 표시되지 :UIBezierPaths는
(void) drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx
{
float r = self.bounds.size.width/2;
CGContextClearRect(ctx, self.bounds); // clear layer
CGContextSetFillColorWithColor(ctx, [UIColor whiteColor].CGColor);
//CGContextFillRect(ctx, layer.bounds);
UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(0, 0) radius:r startAngle:-M_PI_2 endAngle:M_PI_2 clockwise:NO];
CGContextAddPath(ctx, path.CGPath);
CGContextStrokePath(ctx);
}
참고가 나는 CGContextFillRect(ctx, layer.bounds)
의 주석을 해제하는 경우 직사각형이 제대로 렌더링됩니다. 당신이 채우기 그것이 에 사용되는 색상을 채우기 경로를 구성 할 때 내가 볼 수
획 색상이 누락 되었습니까? –