iOS开发

(IOS)为UICollectionViewCell设置圆角和阴

2018-08-10  本文已影响0人  rightmost

 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;

上一篇 下一篇

猜你喜欢

热点阅读