控制器:
SV_InfiniteView *view = [[SV_InfiniteView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 50.0)];
[self.tableView.infiniteScrollingView setCustomView:view forState:SVInfiniteScrollingStateAll];
SV_InfiniteView:
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
UIImageView *logoImageView = [[UIImageView alloc] initWithFrame:CGRectMake(148.0, 13.0, 24.0, 24.0)];
logoImageView.image = [UIImage imageNamed:@"loading"];
[self addSubview:logoImageView];
CABasicAnimation* rotationAnimation;
rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
rotationAnimation.toValue = [NSNumber numberWithFloat: M_PI * 2.0];
rotationAnimation.duration = 3.0;
rotationAnimation.cumulative = YES;
rotationAnimation.repeatCount = HUGE_VALF;
[logoImageView.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
}
return self;
}
但动画不起作用。