- (void)awakeFromNib {
    // Initialization code
    _btnViews.layer.shadowPath =[UIBezierPath bezierPathWithRect:_btnViews.bounds].CGPath;
    _btnViews.layer.shadowColor = [UIColor grayColor].CGColor;//shadowColor阴影颜色
    _btnViews.layer.shadowOffset = CGSizeMake(0,3);//shadowOffset阴影偏移,x向右偏移4,y向下偏移4,默认(0, -3),这个跟shadowRadius配合使用
    _btnViews.layer.shadowOpacity = 0.5;//阴影透明度,默认0
    _btnViews.layer.shadowRadius = 2;//阴影半径,默认3
    
    
    _labAuthorTitle.layer.shadowPath =[UIBezierPath bezierPathWithRect:_labAuthorTitle.bounds].CGPath;
    _labAuthorTitle.layer.shadowColor = [UIColor grayColor].CGColor;//shadowColor阴影颜色
    _labAuthorTitle.layer.shadowOffset = CGSizeMake(2,2);//shadowOffset阴影偏移,x向右偏移4,y向下偏移4,默认(0, -3),这个跟shadowRadius配合使用
    _labAuthorTitle.layer.shadowOpacity = 0.5;//阴影透明度,默认0
    _labAuthorTitle.layer.shadowRadius = 2;//阴影半径,默认3
    
    _labAuthorSubTitle.layer.shadowPath =[UIBezierPath bezierPathWithRect:_labAuthorSubTitle.bounds].CGPath;
    _labAuthorSubTitle.layer.shadowColor = [UIColor grayColor].CGColor;//shadowColor阴影颜色
    _labAuthorSubTitle.layer.shadowOffset = CGSizeMake(2,2);//shadowOffset阴影偏移,x向右偏移4,y向下偏移4,默认(0, -3),这个跟shadowRadius配合使用
    _labAuthorSubTitle.layer.shadowOpacity = 0.5;//阴影透明度,默认0
    _labAuthorSubTitle.layer.shadowRadius = 2;//阴影半径,默认3
   
   
}

 如上,给Cell添加完阴影后 ,屏幕出现卡顿现象,tableview 拖动时有抖动现象。

增加此句就OK了。

_labAuthorSubTitle.layer.shadowPath =[UIBezierPath bezierPathWithRect:_labAuthorSubTitle.bounds].CGPath;

相关文章:

  • 2021-06-30
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2022-02-14
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案