taiyang2014

view添加虚线边框

  CAShapeLayer *border = [CAShapeLayer layer];
       
        border.strokeColor = SLColorLine.CGColor;
       
        border.fillColor = nil;
       
        border.path = [UIBezierPath bezierPathWithRect:self.bounds].CGPath;
       
        border.frame = self.bounds;
       
        border.lineWidth = 1.f;
       
        border.lineCap = @"square";
       
        border.lineDashPattern = @[@4, @2];
       
        [self.layer addSublayer:border];

posted on 2015-12-04 17:05  taiyang2014  阅读(251)  评论(0编辑  收藏  举报

导航