美文网首页iOS开发
(IOS)为UICollectionViewCell设置圆角和阴

(IOS)为UICollectionViewCell设置圆角和阴

作者: rightmost | 来源:发表于2018-08-10 17:29 被阅读0次

 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设置圆角和阴

    本文链接:https://www.haomeiwen.com/subject/cpjlbftx.html