J'utilise le code ci-dessous pour dessiner un arc dans la drawLayer méthode d'une coutume CALayer
classe, mais rien ne s'afficheUIBezierPaths Non Affichage en CALayer drawLayer inContext
(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);
}
Notez que si je décommenter le CGContextFillRect(ctx, layer.bounds)
ligne, un rectangle est correctement rendu.
Vous ne disposez pas d'une couleur de contour? –