📅  最后修改于: 2022-03-11 15:00:28.843000             🧑  作者: Mango
viewpager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
@Override
public void onPageSelected(int position) {
super.onPageSelected(position);
View child = viewPager2.getChildAt(0);
if (child instanceof RecyclerView)
child.setOverScrollMode(View.OVER_SCROLL_NEVER);
}
}