美文网首页
NestedScrollView 嵌套 RecyclerView

NestedScrollView 嵌套 RecyclerView

作者: 余炳高笔记 | 来源:发表于2019-06-12 19:43 被阅读0次

    禁掉 RecyclerView 滚动

    RecyclerView.setNestedScrollingEnabled(false);

    水平滚动 RecyclerView 实现 ViewPager 效果在setAdapter()后面填添加 PagerSnapHelper 

    LinearLayoutManager layoutManager =new LinearLayoutManager(getContext());

    layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);

    RecyclerView.setLayoutManager(layoutManager);

    RecyclerView.setAdapter();

    PagerSnapHelper snapHelper =new PagerSnapHelper();

    snapHelper.attachToRecyclerView(RecyclerView);

    相关文章

      网友评论

          本文标题:NestedScrollView 嵌套 RecyclerView

          本文链接:https://www.haomeiwen.com/subject/vgerfctx.html