Questions tagged [uiscrollviewdelegate]

The methods declared by the UIScrollViewDelegate protocol allow the adopting delegate to respond to messages from the UIScrollView class and thus respond to, and in some affect, operations such as scrolling, zooming, deceleration of scrolled content, and scrolling animations.

The methods declared by the UIScrollViewDelegate protocol allow the adopting delegate to respond to messages from the UIScrollView class and thus respond to, and in some affect, operations such as scrolling, zooming, deceleration of scrolled content, and scrolling animations. On UIScrollViewDelegate, you can find the following methods:

Responding to Scrolling and Dragging:

– scrollViewDidScroll:

– scrollViewWillBeginDragging:

– scrollViewWillEndDragging:withVelocity:targetContentOffset:

– scrollViewDidEndDragging:willDecelerate:

– scrollViewShouldScrollToTop:

– scrollViewDidScrollToTop:

– scrollViewWillBeginDecelerating:

– scrollViewDidEndDecelerating:

Managing Zooming:

– viewForZoomingInScrollView:

– scrollViewWillBeginZooming:withView:

– scrollViewDidEndZooming:withView:atScale:

– scrollViewDidZoom:

Responding to Scrolling Animations:

– scrollViewDidEndScrollingAnimation:
398 questions
90
votes
6 answers

Check if a UIScrollView reached the top or bottom

Is there a way to know if a UIScrollView has reached the top or bottom? Possibly in the method: - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate
Duck
  • 34,902
  • 47
  • 248
  • 470
82
votes
10 answers

Detecting UIScrollView page change

Is there a way to detect or get a notification when user changes the page in a paging-enabled UIScrollView?
Pompair
  • 7,083
  • 11
  • 60
  • 69
68
votes
6 answers

Setting contentOffset programmatically triggers scrollViewDidScroll

I've got a a few UIScrollView on a page. You can scroll them independently or lock them together and scroll them as one. The problem occurs when they are locked. I use UIScrollViewDelegate and scrollViewDidScroll: to track movement. I query the…
DBD
  • 23,075
  • 12
  • 60
  • 84
54
votes
2 answers

UICollectionView doesn't bounce when datasource has only 1 item

I have a UICollectionView with a custom UICollectionViewFlowLayout. It scrolls horizontally and only shows one item at a time (full height). I have pagingEnabled = YES so that it sticks to pages. The UICollectionView shows photos within a…
48
votes
9 answers

How to implement horizontally infinite scrolling UICollectionView?

I want to implement UICollectionView that scrolls horizontally and infinitely?
44
votes
7 answers

UIScrollView, reaching the bottom of the scroll view

I know the Apple documentation has the following delegate method: - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView; // called when scroll view grinds to a halt However, it doesn't necessarily mean you are at the bottom. Cause…
Crystal
  • 28,460
  • 62
  • 219
  • 393
40
votes
3 answers

Become UIScrollViewDelegate delegate for UITableView

I have a UITableView instance variable. I want to be able to register my view controller to be the UIScrollViewDelegate for my UITableViewController. I have already tried tableView.delegate = self; But when scrolling, my methods -…
Brian
  • 3,571
  • 7
  • 44
  • 70
39
votes
6 answers

Overriding delegate property of UIScrollView in Swift (like UICollectionView does)

UIScrollView has a delegate property which conforms to UIScrollViewDelegate protocol UIScrollViewDelegate : NSObjectProtocol { //... } class UIScrollView : UIView, NSCoding { unowned(unsafe) var delegate: UIScrollViewDelegate? …
stringCode
  • 2,274
  • 1
  • 23
  • 32
36
votes
5 answers

UIScroll View Delegate not calling ScrollViewDidEndScrollingAnimation

I have implemented the UIScrollViewDelegate protocol in my .h file and i have implemented the - (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView method in my .m class. when the scrolling is done in my table view other delegate…
Gani
  • 709
  • 3
  • 13
  • 21
30
votes
5 answers

scrollViewWillEndDragging:withVelocity:targetContentOffset: not working on the edges of a UISCrollView

I'm trying to implement a custom tab bar which is scrollable and has paging at each tab bar item. For that i'm using the delegate scrollViewWillEndDragging:withVelocity:targetContentOffset: which works perfectly with one problem. The way my paging…
dvieira
  • 683
  • 1
  • 7
  • 19
29
votes
4 answers

In iOS 4.0, why does UIScrollView zoomToRect:animated: not trigger the scrollViewDidScroll or scrollViewDidZoom delegates while animating?

I need to closely monitor the scale of the scroll view so that I can update the content view's elements (a subview managing multiple CALayers) according to the scroll view's animated zoom. On iOS 3.1, everything works as expected, I use…
David
  • 9,635
  • 5
  • 62
  • 68
24
votes
5 answers

Custom UIScrollView paging with scrollViewWillEndDragging

I'm trying to use the new scrollViewWillEndDragging:withVelocity:targetContentOffset: UIScrollView delegate call in iOS 5 but i can't seem to get it to actually respond to me correctly. I'm changing the targetContentOffset->x value but it never ends…
Alex
  • 712
  • 1
  • 5
  • 11
21
votes
7 answers

Want UITableView to "snap to cell"

I am displaying fairly large images in a UITableView. As the user scrolls, I'd like to the table view to always snap the center-most photo in the middle. That is, when the table is in a resting state, it will always have a UITableViewCell snapped to…
VaporwareWolf
  • 10,143
  • 10
  • 54
  • 80
16
votes
7 answers

How can I test if the scroll view is bouncing?

How can I test if the scroll view is bouncing? Is there a notification or something when the bounce ends?
Infinite Possibilities
  • 7,415
  • 13
  • 55
  • 118
14
votes
2 answers

What's the velocity unit in scrollViewWillEndDragging:withVelocity:targetContentOffset:?

The documentation states it's points (per second, I'm assuming)? However, the values I get for it are in the (.5, 3.5) range. The scroll view then travels several hundred points before coming to a halt. The actual initial velocity should be…
RS1
  • 143
  • 1
  • 6
1
2 3
26 27