方法两种:
1.不处理手势
// 不处理手势
recyclerView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
return true;
}
});
2.禁止滑动:
// 禁止recyclerview的滚动
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext(),LinearLayoutManager.VERTICAL,false){
@Override
public boolean canScrollVertically() {
return false;
}
};
禁止滚动优缺点,smoothScrollToPosition滚动方法不可用