Bounce UIScrollView - tell me what's more

I am developing a scroll list application. It is not immediately clear that there is more content, and there is no scroll indicator (scroll view is called up).

So, to give the user "hey, there is something here ...", I would like the scroll view to do a subtle bounce - down, and then at startup. I tried this:

- (void)viewDidLoad .... [NSTimer scheduledTimerWithTimeInterval:0.8 target:self selector:@selector(bounceScrollView) userInfo:nil repeats:NO]; } - (void)bounceScrollView { [self.verticalScrollViews[0] scrollRectToVisible:CGRectMake(0, 600, 1, 1) animated:YES]; [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(_unbounceScrollView) userInfo:nil repeats:NO]; } - (void)_unbounceScrollView { [self.verticalScrollViews[0] scrollRectToVisible:CGRectZero animated:YES]; } 

However, this code makes the view "stuck" about halfway between the two pages.

Any help?

+4
source share
2 answers

Idea 1 : you need to turn off paging, animate the bounce and turn on paging again.

Idea 2 : your second promotion too soon:

 scheduledTimerWithTimeInterval:0.01 

Experiment with longer time intervals! I would start with 0.4 .

Idea 3 . Instead of rebounding, why not use flashScrollIndicators ? This is exactly what for!

+5
source

I had memory issues when using NSTimer. So I used a different scrollView preview solution.

  [UIView animateWithDuration:1.0 delay:0.00 options:UIViewAnimationOptionCurveEaseInOut animations:^{ _scrollView.contentOffset = CGPointMake(200,0); } completion:^(BOOL finished){ [UIView animateWithDuration:1.0 delay:0.00 options:UIViewAnimationOptionCurveEaseInOut animations:^{ _scrollView.contentOffset = CGPointMake(0,0); } completion:^(BOOL finished){ } ]; } ]; 
+1
source

All Articles