iOS SVPullToRefresh infiniteScrollingView设置自定义视图动画不起作用

时间:2014-06-06 07:05:48

标签: ios

控制器:

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;
}

但动画不起作用。

0 个答案:

没有答案