【发布时间】:2014-12-03 07:00:16
【问题描述】:
我想在视图上绘制一个图层。为此我编写了这段代码。
arcLayer=[CAShapeLayer layer];
arcLayer.frame=self.circleView.frame;
arcLayer.backgroundColor = [UIColor purpleColor].CGColor;
[self.circleView.layer addSublayer:arcLayer];
但是如下图所示,图层的位置在视图上并不准确。绿色的是circleView,紫色的是arc layer。
【问题讨论】:
-
arcLayer.frame=self.circleView.bounds