ios 画虚线方法
来源:互联网 发布:java线程池是否繁忙 编辑:程序博客网 时间:2024/04/27 23:19
CAShapeLayer *shapeLayer = [CAShapeLayer layer]; [shapeLayer setBounds:self.lineLayer.bounds]; [shapeLayer setPosition:CGPointMake(CGRectGetWidth(self.lineLayer.frame), CGRectGetHeight(self.lineLayer.frame)/2)]; [shapeLayer setFillColor:[UIColor clearColor].CGColor]; // 设置虚线颜色为blackColor [shapeLayer setStrokeColor:[UIColor blackColor].CGColor]; // 设置虚线宽度 [shapeLayer setLineWidth:CGRectGetWidth(self.lineLayer.frame)]; [shapeLayer setLineJoin:kCALineJoinRound]; [shapeLayer setLineCap:kCALineCapRound]; // 设置线宽,线间距 [shapeLayer setLineDashPattern:[NSArray arrayWithObjects:[NSNumber numberWithInt:1], [NSNumber numberWithInt:3], nil]]; // 设置路径 CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path, NULL, 0, 0); CGPathAddLineToPoint(path, NULL,0, (MAX([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height))/2); [shapeLayer setPath:path]; CGPathRelease(path); // 把绘制好的虚线添加上来 [self.lineLayer.layer addSublayer:shapeLayer];
0 0
- iOS画虚线方法
- ios 画虚线方法
- iOS 画虚线方法总结
- iOS 画虚线方法总结
- ios画虚线的方法
- iOS 画虚线的两种方法
- iOS绘制虚线方法
- iOS绘制虚线方法【原创】
- iOS 画虚线
- iOS 画虚线 cgcontext
- iOS画虚线
- iOS 画虚线
- iOS 画虚线
- iOS:绘图画虚线
- ios 画虚线
- ios 画虚线
- iOS 画虚线
- iOS画虚线
- 项目二 选手评分系统2
- 保持冷静和需要打破的东西:软件测试初学者
- 完全停止Oracle中正在运行的JOB
- 用Lab Windows CVI 从MySQL\Oracle中读写数据
- Retrofit基本介绍
- ios 画虚线方法
- Web项目启动初始化监听器如何获取spring bean
- python爬取cnvd漏洞库信息
- 开源maven包下载
- CUDA Program Analysis
- [Leetcode] Spiral Matrix II
- 杭电2032
- Cmder介绍
- 代码奔溃定位