Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 顶部和底部有边框的CAShapeLayer_Iphone_Ios_Uibezierpath_Quartz Core_Cashapelayer - Fatal编程技术网

Iphone 顶部和底部有边框的CAShapeLayer

Iphone 顶部和底部有边框的CAShapeLayer,iphone,ios,uibezierpath,quartz-core,cashapelayer,Iphone,Ios,Uibezierpath,Quartz Core,Cashapelayer,我正在使用CAShapeLayer和UIBezierPath创建一个图形,它工作正常,但现在我想用多种颜色绘制我的线,如中间的白色和顶部和底部的黑色。我怎样才能做到这一点?这是我的代码: myLayer = [[CAShapeLayer alloc] init]; myLayer.path = pointPath; myLayer.strokeColor = [[UIColor whiteColor] CGColor]; myLayer.lineWidth = 3.0; myLayer.fill

我正在使用
CAShapeLayer
UIBezierPath
创建一个图形,它工作正常,但现在我想用多种颜色绘制我的线,如中间的白色和顶部和底部的黑色。我怎样才能做到这一点?这是我的代码:

myLayer = [[CAShapeLayer alloc] init];
myLayer.path = pointPath;
myLayer.strokeColor = [[UIColor whiteColor] CGColor];
myLayer.lineWidth = 3.0;
myLayer.fillColor = nil;
myLayer.lineJoin = kCALineJoinBevel;
[self.scroll.layer addSublayer:myLayer];

CGPathCreateCopyByStrokingPath
?两条不同宽度的路径?你试过什么,为什么没有成功?