简体   繁体   中英

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM