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 views, and the the white area 
is the "true" set of images.


Say that in the previous image, the leftmost person is the first logical image 
in your set of data. In your viewDidLoad, you could set the contentOffset to 
the position of the first Person (ie. the leftmost white edge) with something 
like:

    - (void)viewDidLoad
    {
        CGFloat someXPos = CGRectGetWidth([pictures frame]) + 
CGRectGetWidth([reticle frame]);
        [scrollView setContentOffset:someXPos];
    }

Then, once the user breaches the threshold value that has duplicates (the gray 
areas), you call the following:

    - (void)scrollViewDidScroll:(UIScrollView *)scrollView
    {
        [scrollView setContentOffset:someXPos animated:NO];
    }

The intent is that the scroll view snaps the container UIView back to a 
position that contains no duplicates. The view has duplicates to account for 
the period of time between sampling of scroll events. Note that this suggestion 
is assuming that the images are fairly small, so that loading them all doesn't 
cause too much memory pressure (which is what I understood from earlier 
messages).

Damian

On Oct 8, 2013, at 4:53 PM, Dave <d...@looktowindward.com> wrote:

> 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

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to