从我的一个其他问题的答案中,我找到了一个GoogleDemoofaListViewsubclass允许项目重新排序。演示效果很好,但我在理解它的工作原理时遇到了一些问题:当一个项目被拖动到ListView边界上方/下方时,ListView开始向上/向下滚动以显示新项目。必要的计算使用底层ScrollView的不同参数:publicbooleanhandleMobileCellScroll(Rectr){intoffset=computeVerticalScrollOffset();intheight=getHeight();intextent=computeVerticalScroll