Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Hard to say with that piece of code you gave. And in fact, if you're saying, that you have a project, where everything is working under the same conditions, then obviously the conditions aren't the same :) I couldn't reproduce the issue, but here are some assumptions for 2 cases:</p> <ol> <li><p>Creation of UIScrollView with nib.</p> <ul> <li>Just don't forget to create IBOutlet and to bound it to the scrollView element in nib. In a simple view based application just after that I got scrollView working as you wished in animated: both YES and NO. But to make work </li> </ul> <p><code>-(void)scrollViewDidScroll:(UIScrollView *)sender;</code> you must set the delegate:</p></li> </ol> <p><code>yourScrollView.delegate = self;</code></p> <p>where 'self' is class, where you have your scrollViewDidScroll function; btw this class must conform to the 'UIScrollViewDelegate' protocol.</p> <p>2.Creation of UIScrollView object manually.</p> <ul> <li><p>here the idea is basically the same, so I'll just provide some simple code:</p> <pre><code>-(void) creatingScrollView { UIScrollView *newScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(20, 5, 280, 44)]; newScroll.pagingEnabled = YES; newScroll.showsVerticalScrollIndicator = NO; newScroll.showsHorizontalScrollIndicator = NO; // ... some subviews being added to our scroll view newScroll.delegate = self; [self.view addSubview:newScroll]; [newScroll release]; } </code></pre></li> </ul> <p>This works for me. Hope this is helpful.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload