(IOS)为UICollectionViewCell设置圆角和阴影

 cell.contentView.layer.cornerRadius =2.0f;

    cell.contentView.layer.borderWidth =1.0f;

    cell.contentView.layer.borderColor = [UIColor clearColor].CGColor;

    cell.contentView.layer.masksToBounds =YES;


    cell.layer.shadowColor = [UIColor lightGrayColor].CGColor;

    cell.layer.shadowOffset = CGSizeMake(0,2.0f);

    cell.layer.shadowRadius =2.0f;

    cell.layer.shadowOpacity =1.0f;

    cell.layer.masksToBounds =NO;

    cell.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:cell.bounds cornerRadius:cell.contentView.layer.cornerRadius].CGPath;

你可能感兴趣的:((IOS)为UICollectionViewCell设置圆角和阴影)