Con el siguiente fragmento de código, estoy agregando un efecto de sombra a uno de mis UIView. Lo cual funciona bastante bien. Pero tan pronto como establezco la propiedad masksToBounds de la vista en SÍ. El efecto de sombra no se representa más.¿Por qué masksToBounds = YES previene la sombra de CALayer?
self.myView.layer.shadowColor = [[UIColor blackColor] CGColor];
self.myView.layer.shadowOpacity = 1.0;
self.myView.layer.shadowRadius = 10.0;
self.myView.layer.shadowOffset = CGSizeMake(0.0f, 0.0f);
self.myView.layer.cornerRadius = 5.0;
self.myView.layer.masksToBounds = YES; // <-- This is causing the Drop shadow to not be rendered
UIBezierPath *path = [UIBezierPath bezierPathWithCurvedShadowForRect:self.myView.bounds];
self.myView.layer.shadowPath = path.CGPath;
self.myView.layer.shouldRasterize = YES;
¿Tiene alguna idea sobre esto?
Damned! ¡Eso tiene sentido! – jchatard
Muchas gracias ... Me ayudó mucho. Agradecido a ti .. :) – innodeasapps
¡Feliz de ayudar! – TheSquad