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
4
votes
3 answers

check if scrollview.contentset went over certain x value

I have a scrollview and above some image. When the scrollview scrollView.contentOffset.x is past a certain X my image above should animate. I know how to animate. At the moment I'm doing this in the - (void)scrollViewDidScroll:(UIScrollView…
Steaphann
  • 2,797
  • 6
  • 50
  • 109
4
votes
1 answer

How to create UIScrollView with different page sizes (page snapping, bounce)

I'm trying to create custom vertical UIScrollView which could handle multiple pages with different page heights. Assumptions: page height is equal or greater than screen height if page is taller than screen height, it scrolls as usual UIScrollView…
4
votes
2 answers

Units / Dimensions for UIScrollView decelerationRate and velocity?

I am trying to get the velocity of a scrolling UIScrollView after the user has lifted his/her finger so that I can trigger an event when the scrollview's velocity drops below a threshold velocity. The Apple documentation states that the units for a…
4
votes
2 answers

Detect direction of scrolling UICollectionView, load data from REST

Assuming standard configuration (up/down), I'd like to detect when a user is scrolling their UIColletionView up or down (which is subclass of UIScrollView and conforms to UIScrollViewDelegate). I don't see any information straight out of the…
VaporwareWolf
  • 10,143
  • 10
  • 54
  • 80
4
votes
5 answers

UIPageControl not visible when combined with UIScrollView

I'd like to make use of a page control to switch between several viewControllers. I have the following viewController whose associated nib contains a UIScrollView and a UIPageControl. I've placed the scroll view above the page control by using…
4
votes
1 answer

In uiscrollviewdelegate, is it possible to set targetContentOffset to a negative value?

I have a UIScrollView which is the same width as its superview. It has a very wide contentSize and scrolls horizontally. I am trying to use the delegate method scrollViewWillEndDragging:withVelocity:targetContentOffset: to set targetContentOffset->x…
Killian
  • 414
  • 2
  • 10
4
votes
1 answer

UIScrollView scrollViewDidEndDragging not being called when scrolling quickly

I've implemented scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate in my UIScrollViewDelegate. The method gets called no problem except for when I scroll very quickly. If I do three rapid swipes, for instance, the…
puzzl
  • 833
  • 9
  • 19
4
votes
1 answer

UIScrollView ContentOffset not Reaching Edge of Screen

I'm having a problem with UIScrollView, not sure if it's a bug or not, but it's occurring when I implement a UIScrollView with its delegate and a zoomable / pannable image. First off, when I pan the image, it's possible that the contentOffset can…
Ser Pounce
  • 14,196
  • 18
  • 84
  • 169
4
votes
1 answer

UIScrollView not respecting minimumZoomScale after changing the subview

I'm hitting a problem getting a UIScrollView to update correctly in response to a change in the minimum zoom scale. The scrollview has a UIImageView as a subview, and the image property of the UIImageView is set in response to the…
TimD
  • 8,014
  • 2
  • 24
  • 34
3
votes
2 answers

How to "stick" a UIScrollView subview to top/bottom when scrolling?

You see this in iPhone apps like Gilt. The user scrolls a view, and a subview apparently "sticks" to one edges as the rest of the scrollView slides underneath. That is, there is a text box (or whatever) in the scrollView, that as the scrollView hits…
David H
  • 40,852
  • 12
  • 92
  • 138
3
votes
2 answers

With collectionView.isPagingEnabled = true how to know when paging is completed

I have a vertical direction cell that is the same size of the collectionView and I set collectionView.isPagingEnabled = true. There is only 1 active visible cell on screen at a time: layout.scrollDirection = .vertical collectionView.isPagingEnabled…
Lance Samaria
  • 17,576
  • 18
  • 108
  • 256
3
votes
2 answers

Detecting when a UIScrollView it at a certain point and perform an action

I'm trying to figure out how to do this. Been stuck on this for a really ling time. I'm trying to detect when a UIScrollView is in a perfect location and perform an action. Here I have a UIScrollView aligned with images inside like this.…
Frankrockz
  • 594
  • 1
  • 6
  • 24
3
votes
1 answer

UIScrollView change contentInset while scrolling

I’m trying to implement a custom top bar that behaves similarly to the iOS 11+ large title navigation bar, where the large title section of the bar collapses when scrolling down the content: The difference is that my bar needs a custom height and…
Aleksander Maj
  • 243
  • 3
  • 13
3
votes
3 answers

scrollViewDidScroll not getting called (I set the delegate!)

Situation: I am creating an imageGallery which is a viewController that I am presenting modally. I have created it all programatically, I haven't touched the storyboard. The viewController has a scrollView that contains ImageViews, which each hold…
Gareth Miller
  • 332
  • 1
  • 3
  • 10
3
votes
0 answers

UIScrollVIew Changing targetContentOffset not working when pagingEnabled

I have a UIScrollView with pagingEnabled set to YES. some of other configs are: self.pagingEnabled = NO; self.directionalLockEnabled = YES; self.scrollsToTop = NO; self.showsHorizontalScrollIndicator = NO; self.showsVerticalScrollIndicator =…
mlin956
  • 345
  • 1
  • 5
  • 13