我想要可拖动的gridview和正确的滚动。任何人都可以帮助我吗? 我找到了库,但是那个垂直滚动不起作用.. 我试过这个.. https://github.com/thquinn/DraggableGridView
public void setContainer(PagedDragDropGrid container) {
this.container = container;
}
private int positionOfItem(int pageIndex, int childIndex) {
int currentGlobalIndex = 0;
for (int currentPageIndex = 0; currentPageIndex < adapter.pageCount(); currentPageIndex++) {
int itemCount = adapter.itemCountInPage(currentPageIndex);
for (int currentItemIndex = 0; currentItemIndex < itemCount; currentItemIndex++) {
if (pageIndex == currentPageIndex && childIndex == currentItemIndex) {
return currentGlobalIndex;
}
currentGlobalIndex++;
}
}