圓角與陰影有沖突不可共存
常規(guī)設(shè)置圓角?_imgView makeRadius:_imgView.hight/2;(圓形)
再設(shè)置陰影就會有沖突陰影不顯示
設(shè)置一個View作為imgView的父視圖,設(shè)置陰影數(shù)據(jù),最后記得? [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];