Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is impossible to jump to a particular index/item in the loopscrollrect #14

Closed
tammukul opened this issue Aug 25, 2017 · 5 comments
Closed

Comments

@tammukul
Copy link

No description provided.

@qiankanglai
Copy link
Owner

You need to implement it yourself.

@tammukul
Copy link
Author

Do you have a snippet of code which will explain how to do this ?

Since the items are loaded/unloaded as we scroll, how can I scroll to a specific item ?

@qiankanglai
Copy link
Owner

There are two ways in convenience:

(a) add a coroutine for tween (for example move 20 pixels per second...and wait till the position you want). As you can get the child yourself, you know whether it is the right place to stop. However this is not elegant 😸

(b) In fact I've already provided a method called RefillCells and offset is what you need. This method helps refill all cells starting from the specified count. For example RefillCells(3) meaning you have a LoopScroll with idx=3 as the first one.
But the pity is your don't have the animation now.

Just pick the method you want

qiankanglai added a commit that referenced this issue Aug 27, 2017
@tammukul
Copy link
Author

Thank you... this is really useful.

Thanks for documenting it too. Pretty sure lots of people will surely use it properly.

@qiankanglai
Copy link
Owner

https://github.com/qiankanglai/LoopScrollRect/blob/master/Images/ScrollToIndex.gif

new version for Scroll To Index (with coroutine)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants