autoscrolling for UIScrollView

Posted by thndrkiss on Stack Overflow See other posts from Stack Overflow or by thndrkiss
Published on 2010-05-05T09:47:23Z Indexed on 2010/05/05 11:08 UTC
Read the original article Hit count: 693

Hi,

I used the setContentOffset method to scroll to a particular point automatically without user interaction.

[menuScrollView setContentOffset:CGPointMake(600.0,0) animated:YES]

but when i try to call the same method in a looping fashion inorder to slow down the speed of scrolling the scrolling never happens

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 piece of code the scrolling of UIScrollview happens only once (1st iteration( and it does not scroll for remaining 29 interations. What is the problem here ?

© Stack Overflow or respective owner

Related posts about iphone-sdk-3.0

Related posts about uiscrollview