collectionViewCell添加阴影

self.layer.shadowOffset = CGSizeMake(0, 2);

self.layer.shadowColor = [UIColor blackColor].CGColor;

self.layer.shadowOpacity = 0.9;

self.layer.shadowRadius = 4;

self.layer.masksToBounds = NO;

需要加上最后一句,阴影才能显示出来

你可能感兴趣的:(collectionViewCell添加阴影)