bht
bht

Reputation: 1

When i switch View In TabBarController the ScrollView Stop Scroll,How to Solve it?

in Controller A: here the Code:

[UIView animateWithDuration:5 animations:^{
    [self.awardScrollView setContentOffset:CGPointMake(self.awardScrollView.frame.size.width * 19, 0)];
} completion:^(BOOL finished) {
    isFinished = YES;
}];

i set 5s to finish the animation,but i switch controller to B with TabBarController,i found the animation is stop in Controller A.How can i let the ScrollView continue Scroll Background in Controller A even i Switch to Controller B?

Upvotes: 0

Views: 56

Answers (1)

rob mayoff
rob mayoff

Reputation: 385590

Core Animation won't animate a view that's not in the on-screen view hierarchy. When a view is removed from the on-screen view hierarchy, Core Animation removes all animations from the view.

You can add another animation when the view comes back on screen if you want.

Upvotes: 1

Related Questions