【发布时间】:2011-11-23 17:35:33
【问题描述】:
我正在尝试更改 CAShapeLayer 的填充颜色,当 它所在的层被触及。 我可以像这样更改点击图层的背景颜色:
-(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 的颜色? 谢谢!
【问题讨论】:
标签: iphone objective-c core-animation calayer