#import "ZBView.h"
@implementation ZBView
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
CGContextRef context = UIGraphicsGetCurrentContext();
// CGContextSetLineCap(context, kCGLineCapRound);
// CGContextSetLineWidth(context, 3); //线宽
// CGContextSetAllowsAntialiasing(context, true);
// CGContextSetRGBStrokeColor(context, 70.0/255.0, 241.0/255.0, 241.0/255.0 , 1.0); //线的颜色
CGContextBeginPath(context);
CGContextMoveToPoint(context, 0, 0); //起点坐标
CGContextAddLineToPoint(context, self.frame.size.width, self.frame.size.height); //终点坐标
CGContextStrokePath(context);
}
@end
https://www.jianshu.com/p/0546a3b57f16
https://www.jianshu.com/p/c49833c04362
网友评论