collectionviewcell的圆角和阴影问题

来源:互联网 发布:易语言股票助理源码 编辑:程序博客网 时间:2024/05/18 03:21

圆角:
cell.layer.cornerRadius = 7;    cell.contentView.layer.cornerRadius = 7.0f;    cell.contentView.layer.borderWidth = 0.7f;    cell.contentView.layer.borderColor = [UIColor clearColor].CGColor;    cell.contentView.layer.masksToBounds = YES;    
阴影:    cell.layer.shadowColor = [UIColor lightGrayColor].CGColor;    cell.layer.shadowOffset = CGSizeMake(-10,-10);    cell.layer.shadowRadius = 2.0f;    cell.layer.shadowOpacity = 0.4f;    cell.layer.masksToBounds = NO;    cell.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:cell.bounds cornerRadius:cell.contentView.layer.cornerRadius].CGPath;

0 0
原创粉丝点击