ScrollView嵌套多层的RecyclerView,造成界面滑动卡顿
<!--方法一解决滑动冲突、滑动不流畅-->
<RelativeLayout
android:id="@+id/linear_martial"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:descendantFocusability="blocksDescendants"
>
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_martial"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none" />
</RelativeLayout>
recyclerMagicView.setHasFixedSize(true);
recyclerMagicView.setNestedScrollingEnabled(false);
<!--方法二滑动不流畅-->
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false) {
@Override
public boolean canScrollVertically() {
return false;
}
};
recyclerview.setLayoutManager(linearLayoutManager);