圆角与阴影有冲突不可共存
常规设置圆角 _imgView makeRadius:_imgView.hight/2;(圆形)
再设置阴影就会有冲突阴影不显示
设置一个View作为imgView的父视图,设置阴影数据,最后记得 [shadowView addSubview:_imgView];
UIView *shadowView = [[UIView alloc]initWithFrame:_imgView.frame];
[self.View addSubview:shadowView];
shadowView.layer.shadowColor = [UIColor blackColor].CGColor;
shadowView.layer.shadowOffset = CGSizeMake(0, 5);
shadowView.layer.shadowOpacity = 0.2;
shadowView.layer.shadowRadius = 9.0;
shadowView.layer.cornerRadius = 9.0;
shadowView.clipsToBounds = NO;
[shadowView addSubview:_imgView];