【发布时间】:2012-01-27 16:30:40
【问题描述】:
我知道每个 imageViews 都有一个图层(我们可以使用 :imageView.layer 访问它)。我想使用我的imageView 的图层并在其图层中添加一个子图层:shapeLayer(即a CAShapeLayer) 我的代码不起作用,它不显示形状层!
- (void)viewDidLoad
{
imageView = [[UIImageView alloc] initWithFrame:CGRectMake(100, 100, 100, 100)];
[self.view addSubview:imageView];
}
- (void)anotherMethod
{
[imageView.layer addSublayer:shapeLayer];
}
请问我该如何解决?
【问题讨论】:
标签: iphone objective-c cocoa-touch uiimageview calayer