美文网首页
给tableViewCell切圆角

给tableViewCell切圆角

作者: Zavier_copy | 来源:发表于2017-09-26 16:26 被阅读0次

    //给组cell上方设置圆角

    - (void)createTopCornerRadius:(UITableViewCell*)cuCell{

    UIBezierPath*maskPath = [UIBezierPathbezierPathWithRoundedRect:

    cuCell.contentView.boundsbyRoundingCorners:

    UIRectCornerTopLeft|

    UIRectCornerTopRight

    cornerRadii:

    CGSizeMake(10,10)];

    CAShapeLayer*maskLayer = [[CAShapeLayeralloc]init];

    maskLayer.frame= cuCell.contentView.bounds;

    maskLayer.path= maskPath.CGPath;

    cuCell.layer.mask= maskLayer;

    }

    //给组cell下方设置圆角

    - (void)createBottomCornerRadius:(UITableViewCell*)cuCell{

    UIBezierPath*maskPath = [UIBezierPathbezierPathWithRoundedRect:

    cuCell.contentView.boundsbyRoundingCorners:

    UIRectCornerBottomLeft|

    UIRectCornerBottomRight

    cornerRadii:

    CGSizeMake(10,10)];

    CAShapeLayer*maskLayer = [[CAShapeLayeralloc]init];

    maskLayer.frame= cuCell.contentView.bounds;

    maskLayer.path= maskPath.CGPath;

    cuCell.layer.mask= maskLayer;

    }

    相关文章

      网友评论

          本文标题:给tableViewCell切圆角

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