ios CALayer 委托 displayLayer 未调用
来自: http: //mysterycoconut.com/blog/2011/01/cag1/
- (id)initWithCoder:(NSCoder *)aDecoder;
{
if (self = [super initWithCoder:aDecoder])
{
MyLayer* _myLayer = [MyLayer layerWithImage:img sampleSize:fSize];
_myLayer.delegate = self;
CABasicAnimation *anim = [CABasicAnimation animationWithKeyPath:@"imageIndex"];
anim.fromValue = [NSNumber numberWithInt:1];
anim.toValue = [NSNumber numberWithInt:5];
anim.duration = 2f;
anim.repeatCount = 1;
[richter addAnimation:anim forKey:nil];
[self.view.layer addSublayer:_myLayer];
}
return self;
}
// CALayer delegate needs this method for variable sample size to work
- (void)displayLayer:(CALayer *)layer{
}
displayLayer 永远不会被调用?
感谢和问候