Infinite Scroll View Revisited

2013-10-16 Thread Dave
Hi, This has been bugging me for a while and today, I've managed to grab some time in order to try and get it working. I based my class on the Street Scroller Sample App from Apple. The main methods that are important in Street Scroller are: - (void)recenterIfNecessary { CGPoint

Re: Infinite Scroll View?

2013-10-09 Thread Dave
Hi, Got it working! The problem was partly due to tiredness and partly due to a misunderstanding about when layoutSubviews gets called. If you look at the Street Scroller sample, you'll see that it has its content in-built, in fact it generate new content on the fly. The problem I had was

Re: Infinite Scroll View?

2013-10-08 Thread Dave
On 7 Oct 2013, at 19:54, Kyle Sluder k...@ksluder.com wrote: On Mon, Oct 7, 2013, at 09:21 AM, Dave wrote: 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

Re: Infinite Scroll View?

2013-10-08 Thread Kyle Sluder
On Oct 8, 2013, at 12:44 AM, Dave d...@looktowindward.com wrote: Thanks Kyle, That's what I was trying to figure out, whether I needed to re-layout the views based on the positions or whether I could just do it by keeping an Array of the image views separately and rotating this as it

Re: Infinite Scroll View?

2013-10-08 Thread Dave
Hi, I finally managed to get back on this! I've got it working when scrolling from left to right and can detect when the user scrolls past the last item, however, I can't seem to find a way to detect when the user scrolls to before the first item. I get -0 for offset X 2013-10-08

Re: Infinite Scroll View?

2013-10-08 Thread Steve Christensen
Does (scrollView.contentOffset.x = 0) not work? How are you testing for it now? On Oct 8, 2013, at 12:20 PM, Dave d...@looktowindward.com wrote: Hi, I finally managed to get back on this! I've got it working when scrolling from left to right and can detect when the user scrolls past the

Re: Infinite Scroll View?

2013-10-08 Thread Dave
Well, it never goes less than -0 whatever that means so the is redundant and 0 is a valid offset, I need to detect a scroll to *before* 0, which I never get. Thanks Dave On 8 Oct 2013, at 21:26, Steve Christensen puns...@mac.com wrote: Does (scrollView.contentOffset.x = 0) not work? How are

Re: Infinite Scroll View?

2013-10-08 Thread Dave
Hi, Spoke too soon! I just can't seem to get my head around this. I can make it work, but I'm getting into an infinite loop because updating the scroll view is causing the delegates to fire again (AFAICT). I'm not sure what to put in layoutSubviews and what to put in the delegate methods.

Re: Infinite Scroll View?

2013-10-08 Thread Marcelo Alves
Did you check the StreetScroller sample? https://developer.apple.com/library/ios/samplecode/StreetScroller/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011102 it is the same code that was demonstrated in the WWDC 2011 I told you before. -- :: marcelo.alves On 08/10/2013, at 17:30, Dave

Re: Infinite Scroll View?

2013-10-08 Thread Dave
Hi, Yes, I took a look, but it's not what I want to do. I have a number of variable width images, not fixed width and all the examples I've seen use pagingEnabled and have a fixed width. Also the Street Scroller sample, just creates a label view on demand, which, again isn't what I want. I

Re: Infinite Scroll View?

2013-10-08 Thread Damian Carrillo
Hi Dave, What about if you have some repetition of the images? Say the following is a container UIView that has all of your UIImageViews stacked horizontally and the width of the following view is far smaller than that of the UIScrollView it's contained in. The gray areas are duplicated image

Infinite Scroll View?

2013-10-07 Thread Dave
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

Re: Infinite Scroll View?

2013-10-07 Thread Marcelo Alves
There’s a WWDC video from 2011 : “Advanced ScrollView Techniques” which explains one way to do infinite scrolling. Look at 18:08 if it is what you want. On 07/10/2013, at 13:21, Dave d...@looktowindward.com wrote: Hi, I'd like to be able to Scroll Infinitely in a Scroll, e.g. when the

Re: Infinite Scroll View?

2013-10-07 Thread Steve Christensen
Have you thought about representing your images as cells in a UITableView? If so, you could use something like BBTableView (https://github.com/bharath2020/UITableViewTricks). It's a subclass of UITableView lays out cells along an arc but it also has support for infinite scrolling, so you could

Re: Infinite Scroll View?

2013-10-07 Thread Dave
Hi, I don't think that will work for me in this case as I need the images to be scrolled smoothly without gaps and AFAIK, using a table view cell will cause a gap - you can add a fragment of an image. Thanks anyway All the Best Dave On 7 Oct 2013, at 18:11, Steve Christensen puns...@mac.com

Re: Infinite Scroll View?

2013-10-07 Thread Steve Christensen
Does it not work to set the row height to the height of each of the images and then use a custom UITableViewCell that contains a UIImageView that fills the cell? The other benefit is that you don't have to have more images in memory than are visible within the table view's frame. (This may not

Re: Infinite Scroll View?

2013-10-07 Thread Kyle Sluder
On Mon, Oct 7, 2013, at 11:04 AM, Steve Christensen wrote: Does it not work to set the row height to the height of each of the images and then use a custom UITableViewCell that contains a UIImageView that fills the cell? The other benefit is that you don't have to have more images in memory

Re: Infinite Scroll View?

2013-10-07 Thread Kyle Sluder
On Mon, Oct 7, 2013, at 09:21 AM, Dave wrote: 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