美文网首页
UITableViewCell分割线

UITableViewCell分割线

作者: CALayer_Sai | 来源:发表于2017-12-26 13:46 被阅读0次

    UITableViewCell分割线的自定义
    一:将系统隐藏,自己自定义一条;
    二:在cell中重写
    // 重写底部分割线

    • (void)drawRect:(CGRect)rect
      {
      CGContextRef context = UIGraphicsGetCurrentContext();

      CGContextSetFillColorWithColor(context, [UIColor whiteColor].CGColor);
      CGContextFillRect(context, rect);

      CGContextSetStrokeColorWithColor(context, [UIColor colorWithRed:0xE2/255.0f green:0xE2/255.0f blue:0xE2/255.0f alpha:0.9].CGColor);
      CGContextStrokeRect(context, CGRectMake(10, rect.size.height - 0.5, rect.size.width-10, 0.5));
      }

    相关文章

      网友评论

          本文标题:UITableViewCell分割线

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