Here is my code:
CALayer *inLayer =[CALayer layer];
inLayer.backgroundColor = [UIColor redColor].CGColor;
inLayer.frame=CGRectMake(0,0,50, 50);
inLayer.position=CGPointMake(200, 200);
inLayer.cornerRadius=25;
inLayer.masksToBounds=YES;
inLayer.shadowColor=[UIColor blackColor ].CGColor;
inLayer.shadowOffset=CGSizeMake(5,10);
inLayer.shadowOpacity = 0.8;
inLayer.contents=(id)[UIImage imageNamed:@"Close.png"].CGImage;
inLayer.name=@"Close";
[self.view.layer addSublayer:inLayer];
i don’t get shadow. something i miss there?
just remove this line:
your code works fine