-
Notifications
You must be signed in to change notification settings - Fork 68
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
Scrollbar and scroll to element #4
Comments
Hey! |
Also from our side: Please implement it, as soon as it suits you. Scrollbar is largely useful on PC, of course, where your solution becomes handy if you want to use it for 1,000 items in a grid or list. |
Hey! Thanks for this great asset! It is amazing and really easy to use Just wondering if there is any update on "scroll to element by index." functionality? Thanks! |
Just an addition of a scrollbar would make it perfect. |
Hey everyone! In my case, I had the necessity to scroll to the end of the list. This is how I did it in public void ScrollToEnd()
{
var totalItems = DataSource.GetItemCount();
var totalCells = _cellPool.Count;
if (_cellHeight * totalItems <= _recyclableViewBounds.size.y)
return;
int cellIndex = bottomMostCellIndex;
int itemIndex = totalItems - 1;
for (int i = 0; i < totalCells; i++)
{
DataSource.SetCell(_cachedCells[cellIndex], itemIndex);
itemIndex--;
if (cellIndex == 0)
cellIndex = totalCells - 1;
else
cellIndex--;
}
currentItemCount = totalItems;
Content.anchoredPosition = Vector2.up * _recyclableViewBounds.size.y;
} This is how I called it in the public void ScrollDown()
{
onValueChanged.RemoveListener(OnValueChangedListener);
((VerticalRecyclingSystem)_recyclingSystem).ScrollToEnd();
verticalNormalizedPosition = 0;
StopMovement();
onValueChanged.AddListener(OnValueChangedListener);
} It's far from ideal and requires more testing, but it was good enough for my needs. I'd love to actually implement this in a PR caring for the other views and grids, but I can't promise to do that, unfortunately. |
this:
I don't know if this is a satisfactory answer, but if you apply the height of ScrollRect to positionOffset, it will scroll to the bottom after ReloadData(). |
Hi @MdIqubal, I want to thank you for the work you put in this code. I found it very useful.
` |
I think it wrong. |
I implement scrolling to element by:
added this code to RecyclableScrollRect.cs :
|
Haro!
Thanks for creating it, it amazing!
But, Can you add support recyclable scroll work correct with scrollbar?
and add method support scroll to element by index.
The text was updated successfully, but these errors were encountered: