I have UIScrollView with 3 pages. It’s difficult for me to explain my issue, that’s why I will try to explain it comparing with table view.
When you have table view, you can scroll to see space that doesn’t exist. I mean if you see 1 cell, you can scroll down and see white space without cells. I don’t know the definition, that’s why I will call it “Scroll to empty space”.
Now is the question. I want to implement following:
when user sees 1 page, he can’t “Scroll to empty space” and when user is in the last page, he can “Scroll to empty space”
My code is:
self.scroll = [[[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)] autorelease];
scroll.pagingEnabled = YES;
scroll.showsHorizontalScrollIndicator = NO;
scroll.showsVerticalScrollIndicator = NO;
scroll.scrollsToTop = NO;
scroll.delegate = self;
scroll.contentSize = CGSizeMake(size.width * kNumberOfPages, size.height);
scroll.backgroundColor = [UIColor greenColor];
What properties should I set to provide required functionality.
That’s called bouncing.
UIScrollViewhas a property calledbouncesthat you can set to NO to prevent it from bouncing:You can set the value of that property to the value you require in your scroll delegate
– scrollViewDidScroll:method.