码迷,mamicode.com
首页 > 其他好文 > 详细

UIView画虚线边框

时间:2016-05-18 21:19:24      阅读:172      评论:0      收藏:0      [点我收藏+]

标签:

//fatherView加虚线边框

-(void)boundingRectangleForView:(UIView *)fatherView{
    
    CAShapeLayer *borderLayer = [CAShapeLayer layer];
    borderLayer.fillColor = [UIColor clearColor].CGColor;
    borderLayer.strokeColor = [UIColor nvColorWith666].CGColor;
    borderLayer.path = [UIBezierPath bezierPathWithRect:fatherView.bounds].CGPath;
    borderLayer.lineWidth = 1.f;
    borderLayer.lineCap = @"square";
    borderLayer.lineDashPattern = @[@6, @2];
    [fatherView.layer addSublayer:borderLayer];
}

 

UIView画虚线边框

标签:

原文地址:http://www.cnblogs.com/Xylophone/p/5506174.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!