collectionview设置圆角和阴影

self.contentView.layer.masksToBounds = YES;

self.contentView.layer.cornerRadius = 3;

self.contentView.layer.borderWidth = 1;

self.contentView.layer.borderColor = FXRGBA(0, 0, 0, 0.08).CGColor;

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

self.layer.shadowColor = FXRGBColor(0, 0, 0).CGColor;

self.layer.shadowOpacity = 0.1;

self.layer.shadowRadius = 4;

self.layer.masksToBounds = NO;

不知道为什么cell设置阴影必须把masks设置为NO不然无效,但这是就不能设置阴影了,所以在contentView和cell上分别设置

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容