8
레이어가 포함되어있을 때 CAShapeLayer의 fillColor를 변경하려고합니다. 나는이 같은 도청 층의 배경 색상을 변경할 수있어 예상대로이 "레이어"파란색의 배경을 전환선택한 CAShapeLayer의 fillColor를 변경하십시오.
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
CALayer *layer = [(CALayer *)self.view.layer.presentationLayer hitTest:point];
layer = layer.modelLayer;
layer.backgroundColor = [UIColor blueColor].CGColor;
}
. 내 문제는 "레이어"내부 CAShapelayer의 색상을 어떻게 변경합니까? 감사합니다.
CAShapeLayer* shapeLayer = (CAShapeLayer*)layer.modelLayer;
shapeLayer.fillColor = [UIColor blueColor].CGColor;
도 참조 : CAShapeLayer