• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Infinite Scroll View?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Infinite Scroll View?


  • Subject: Infinite Scroll View?
  • From: Dave <email@hidden>
  • Date: Mon, 07 Oct 2013 17:21:15 +0100

Hi,

I'd like to be able to Scroll Infinitely in a Scroll, e.g. when the scrolling is past the last item in the Scroll start displaying the first and when scrolling before the first item, starting displaying the last. The items in this case are UIImageViews and they have a fixed height and a variable width and no one image will be wider that the Scroll View itself. Also it needs to work with pagingEnables = NO, e.g. there will be more than one Image visible.

I've playing around a bit and found a some sample code that sort of does it but it doesn't handle the wrapping the Images smoothly (is was written to have paging enabled).

My plan was/is to detect when the scrolling had hit before the first/after the last and to move the first Subview to the End or the Last one to the beginning, depending on the direction of movement, but at the moment, I can't seem to see a way of detecting these conditions.

I logged contentOffset and contentSize in the scrollViewDidScroll delegate method and got these results:


scrollViewDidScroll Offset: {4017, 0}   - Size: {5119, 200}
scrollViewDidScroll Offset: {4061, 0}   - Size: {5119, 200}
scrollViewDidScroll Offset: {4095, 0}   - Size: {5119, 200}

When hitting the end and

scrollViewDidScroll Top Scroll View Offset: {106, 0}  - Size: {5119, 200}
scrollViewDidScroll Top Scroll View Offset: {24, 0}   - Size: {5119, 200}
scrollViewDidScroll Top Scroll View Offset: {-0, 0}   - Size: {5119, 200}

When hitting the start.

I'm not sure how if I can detect the start/end conditions using these values?

Any points on the best way to implement this would greatly appreciated!

All the Best
Dave

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Infinite Scroll View?
      • From: Kyle Sluder <email@hidden>
    • Re: Infinite Scroll View?
      • From: Steve Christensen <email@hidden>
    • Re: Infinite Scroll View?
      • From: Marcelo Alves <email@hidden>
  • Prev by Date: Re: Predicate syntax and localisation
  • Next by Date: Re: Infinite Scroll View?
  • Previous by thread: Scroll View Resizing Problem
  • Next by thread: Re: Infinite Scroll View?
  • Index(es):
    • Date
    • Thread