项目中展示两个RecyclerView ,所以在 ScrollView下嵌套了两个,完成后发现界面滑动不流畅,还会出现卡顿的情况,严重影响了用户的使用。网上查询资料,经测试目前有两种方法解决:
1、recyclerView.setNestedScrollingEnabled(false);
简单粗暴,在代码下加入这行代码。
2、自定义ScrollView
public class ScrollView extends ScrollView{
private int downX;
private int downY;
private int mTouchSlop;
public TopicScrollView(Context context) {
super(context);
mTouchSlop= ViewConfiguration.get(context).getScaledTouchSlop();
}
public TopicScrollView(Context context, AttributeSet attrs) {
super(context, att