Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Recyclerview仅显示完全可见的项目_Android_Android Recyclerview - Fatal编程技术网

Android Recyclerview仅显示完全可见的项目

Android Recyclerview仅显示完全可见的项目,android,android-recyclerview,Android,Android Recyclerview,我想实现recyclerview,在其中滚动时,只有完全可见的项目才会像play store中那样显示 如果下一个元素没有完全可见所需的空间,它将被隐藏。SnapHelper用于这种情况 RecyclerView list = (RecyclerView) view.findViewById(R.id.list); SnapHelper snapHelper = new LinearSnapHelper(); snapHelper.attachToRecyclerView(list); 对re

我想实现recyclerview,在其中滚动时,只有完全可见的项目才会像play store中那样显示


如果下一个元素没有完全可见所需的空间,它将被隐藏。

SnapHelper用于这种情况

RecyclerView list = (RecyclerView) view.findViewById(R.id.list);
SnapHelper snapHelper = new LinearSnapHelper();
snapHelper.attachToRecyclerView(list);
对recyclerview.yep使用SnapHelper,最有可能是:LinearSnapHelper