如何在Android中以编程方式水平滚动GridView?

时间:2016-07-27 06:37:34

标签: android gridview android-recyclerview

smoothScrollBy可以使用RecycleView方法滚动。但Gridview没有扩展GridView。如何像RecycleView一样滚动gridView.smoothScrollBy(0, dy);

尝试使用var CustDetails = { cname: $scope.CusDetails.cname, comname: $scope.CusDetails.comname, tel: $scope.CusDetails.tel, email: $scope.CusDetails.email }; ,但它没有任何效果。

2 个答案:

答案 0 :(得分:0)

我认为您正在寻找smoothScrollByOffset(int offset) 偏移量 - 从适配器位置偏移以滚动到的量。 您也可以使用smoothScrollToPosition(int position)

答案 1 :(得分:0)

我认为您要查找的方法是来自AbsListView的scrollListBy(int y)

将视图中的列表项滚动指定数量的 像素。

您也可以使用smoothScrollBy(int y, int duration)进行平滑滚动。

相关问题