在draggable gridview中获取android中的垂直滚动错误

时间:2013-11-29 07:56:42

标签: android gridview

我想要可拖动的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++;
        }
    }

1 个答案:

答案 0 :(得分:1)

试试这个链接...... https://github.com/nhaarman/ListViewAnimations

它提供可拖动的网格项....