Search code examples
iosxcodeuiscrollviewcontentoffset

Tracking UIScrollview contentoffset - iOS


I have a scrollview with frame smaller than the contentsize. The scrollview is paging enabled. This is similar to the safari new tab page in iOS Safari app. My question is "I have 4 images A,B,C and D. If B is inside the frame is it possible for me know what objects that are not within the frame?" Here is the screenshot for the implemented UIScrollview. The black box with low alpha component is to be replaced by blurry effect on the other pages.


Solution

  • did you try implementing the delegate methods; scrollviewdidscroll or scrollviewdidenddecelerating? Here you can simply get the scrollview.contentoffset.