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

你好可以增加功能吗? 内容从下往上,例如盖楼,从底部开始往上面盖的 #4

Open
tpnet opened this issue Nov 9, 2019 · 2 comments

Comments

@tpnet
Copy link

tpnet commented Nov 9, 2019

你好可以增加功能吗? 内容从下往上,例如盖楼,从底部开始往上面盖的,超出屏幕了,就可以下滑显示高的楼层。

@hyunamy
Copy link

hyunamy commented Jul 25, 2024

hello, i love this scrollview!! and i want this function too. :)

@aillieo
Copy link
Owner

aillieo commented Jul 26, 2024

hello, i love this scrollview!! and i want this function too. :)

Thank you for your support.

The requirement you mentioned is indeed very common. However, I apologize as I am currently quite busy and will consider addressing this in the future when I have more time.

In fact, how to display the corresponding Item based on an index is determined by the update function:

void SetUpdateFunc(Action<int, RectTransform> func)

You can achieve this by modifying the passed function to swap the order of the indices. For example:

SetUpdateFunc((idx, rect) => {
    // idx = totalItemCount - 1 - idx;
    // var dataForIndex = dataSource[idx];
    // rect.UpdateView()
});

Please note that if you are using other delegate functions involving the index, such as SetItemSizeFunc and SetItemGetAndRecycleFunc, you will need to modify them accordingly as well.

I hope this can help.

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

3 participants