几个月前,我也遇到过同样的问题,唯一对我有效的解决方案是创建您自己的自定义RecyclerView和NestedScrollView:
MerohorizontalRecyclerView类
public class MeroHorizontalRecyclerView extends RecyclerView {
private GestureDetector mGestureDetector;
public MeroHorizontalRecyclerView(Context context) {
super(context);
init();
}
public MeroHorizontalRecyclerView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
init();
}
public MeroHorizontalRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
private void init() {
LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
setLayoutManager(layoutManager);
mGest