I have the same problem as the link here: Can't add a corner radius and a shadow
if I put maskToBounds = YES, I get round corners, but no shadow If I put maskToB
Unfortunately, I don't think UIImageView supports rounded corner and shadow at the same time.
You can, however, make the shadow in the UIImageView's super view.
CGFloat cornerRadius = 3.0
UIView *container = [[UIView alloc] initWithFrame:aRect];
container.layer.shadowOffset = CGSizeMake(0, 0);
container.layer.shadowOpacity = 0.8;
container.layer.shadowRadius = 5.0;
container.layer.shadowColor = [UIColor redColor].CGColor;
container.layer.shadowPath = [[UIBezierPath bezierPathWithRoundedRect:container.bounds cornerRadius:cornerRadius] CGPath];
self.userImageView.layer.cornerRadius = cornerRadius;
self.userImageView.layer.masksToBounds = YES;
self.userImageView.frame = container.bounds;
[container addSubview:self.userImageView];
[self addSubview:container];