iOS 重新cell, cell切圆角, cell设置阴影效果等...

- (void)setFrame:(CGRect)frame {
    static CGFloat margin = 15;
    frame.size.height -=margin;
    //阴影偏移效果 - wsx注释
    self.layer.shadowColor = [UIColor lightGrayColor].CGColor;
    self.layer.shadowOffset = CGSizeMake(4, 4);
    self.layer.shadowOpacity = 0.8f;
    
    self.layer.cornerRadius = 5.0f;
    self.layer.borderWidth = 1.0f;
    self.layer.borderColor = [UIColor redColor].CGColor;
    self.layer.masksToBounds = YES;

    [super setFrame:frame];
}

推荐阅读更多精彩内容