I used the setContentOffset method to automatically scroll to a specific point without user interaction.
[menuScrollView setContentOffset:CGPointMake(600.0,0) animated:YES]
but when I try to call the same method with a loop to slow down the scroll speed, the scroll will never happen
for (int i = 1; i<=30; i++) {
[menuScrollView setContentOffset:CGPointMake(600.0-i*10,0.0) animated:YES];
NSLog(@"%f",600.0-i*10);
}
During the above code snippet, UIScrollview scrolls only once (1st iteration (and it does not scroll for the remaining 29 interactions). What is the problem?
source
share