如何检查网格视图达到屏幕的底部?我想告诉更多的图片,当它到达底部我想、网格、视图、当它

2023-09-06 21:46:32 作者:盖世小可爱

嘿,伙计们我解析净数据并显示在网格中的图像当活动被启动仅10张图像来从所述服务器和示于网格中一排3的图像。我想加载更多的图像当用户滚动下来,到达那里只有一个图片

Hey guys I am parsing data from net and showing the images in grid When the activity is launched only 10 images come from the server and are shown in grid with 3 images in one row. I want to load more images when the user scrolls down and reaches the row where there is only one image

有一种方法onScrollChanged(int类型l,诠释T,INT oldl,诠释oldt),这我刚才用来做定制的ListView

There is a method onScrollChanged(int l, int t, int oldl, int oldt) which i have used earlier to make custom listView

但在这种情况下,我不知道如何使用它

But in this case i dont know how to use it

推荐答案

一个做到这一点的方法是检测它在您的适配器 getView 方法。您可以检查,看看是否位置参数是指已加载的最后一个。

One way to do this is to detect it in your adapter's getView method. You can check to see if the position parameter refers to the last one you have loaded.