Re: Infinite Scroll View?
Re: Infinite Scroll View?
- Subject: Re: Infinite Scroll View?
- From: Dave <email@hidden>
- Date: Tue, 08 Oct 2013 22:53:49 +0100
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 have (say) 20 variable width images, so I want it to scroll from image 1 to 20 and then back to 1. The samples doesn't do anything like this.
Thanks anyway,
All the Best
Dave
On 8 Oct 2013, at 22:01, Marcelo Alves <email@hidden> wrote:
> 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 <email@hidden> wrote:
>
>> 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. I'm beginning to think this just isn't possible with UIScrollView and wondering if I should burn a DTS Support Request on it.
>>
>> This would be so easy if I just had the source to UIScrollView!
>>
>> All the Best
>> Dave
>>
>> On 8 Oct 2013, at 20:20, Dave <email@hidden> 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 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 20:18:20.607 LTWScrollTest1[17988:a0b] contentOffset : {-0, 0}
>>>
>>> But that doesn't do me much good!
>>>
>>> It seems to work quite nicely going left to right, but having difficulties figuring out how to make it work scrolling right to left.
>>>
>>>
>>> Any idea greatly appreciated as I'm need to get this working for tomorrow morning!
>>>
>>> Thanks a lot.
>>>
>>> All the Best
>>> Dave
>>>
>>>
>>>
>>> On 8 Oct 2013, at 08:56, Kyle Sluder <email@hidden> wrote:
>>>
>>>>> On Oct 8, 2013, at 12:44 AM, Dave <email@hidden> 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 scroll past the end. I sort of got this working, but of course the Subviews of the Scroll View just grows and grows!
>>>>>
>>>>> This is what I got at the moment:
>>>>>
>>>>> // Scroll past last item detected (in the scrollViewDidScroll delegate method)
>>>>>
>>>>> if (theScrollView.contentSize.width - theScrollView.contentOffset.x <= 1024)
>>>>> {
>>>>> myContentInfo = [self.pContentArray objectAtIndex:0];
>>>>> [self.pContentArray addObject:myContentInfo];
>>>>> [self.pContentArray removeObjectAtIndex:0];
>>>>>
>>>>> [self addContentInfo:myContentInfo withEndFlag:YES];
>>>>> }
>>>>>
>>>>> Which kind of works, but obviously isn't the way to do it.
>>>>>
>>>>> Thanks for confirming I needed to use -layoutSubviews, I'm about to start on this track now.
>>>>
>>>> You don’t *have* to use -layoutSubviews, but you'll probably get the best results if you do. You could theoretically do this all in the delegate's implementation of -scrollViewDidScroll:, but that’ll probably double the number of layout passes and certainly multiply the number of message sends. When scrolling, you want to avoid as much unnecessary work as is reasonable.
>>>>
>>>> It’s kind of a bummer that you’re going to need to split your logic up between the scroll view and its delegate, thus tightly coupling the two. I wish the frameworks exposed many more of their delegate hooks as subclass hooks as well. Scroll views seem to stir this desire particularly frequently.
>>>>
>>>> --Kyle Sluder
>>>
>>>
>>> _______________________________________________
>>>
>>> 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
>>
>>
>> _______________________________________________
>>
>> 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
_______________________________________________
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