【问题标题】:Recycle View in NestedScrollView [duplicate]NestedScrollView 中的 Recyclerview [重复]
【发布时间】:2017-10-18 07:58:19
【问题描述】:

我的回收可以滚动NestedScrollView。然而,它并不像往常一样顺利。谁能帮我解决这个问题。

这是我的代码

<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    android:fillViewport="true">

    <android.support.v7.widget.RecyclerView
         android:id="@+id/fg_movie_list"
         android:layout_width="match_parent"
         android:layout_height="match_parent">

    </android.support.v7.widget.RecyclerView>

</android.support.v4.widget.NestedScrollView>

【问题讨论】:

  • 我在想为什么你需要一个嵌套的滚动视图作为 recyclerview 的父级
  • 我正在使用带有导航抽屉、协调器布局的活动
  • 并且片段包含回收视图
  • 仍然没有意义,因为 recyclerview 是一个可滚动的视图,所以为什么你需要一个嵌套的滚动视图作为父视图
  • 虽然它是重复的,所以让我们在这里关闭它;)祝您编码愉快

标签: android android-recyclerview scrollview


【解决方案1】:

使用

mRecyclerView.setNestedScrollingEnabled(false);
mRecyclerView.setHasFixedSize(true);

【讨论】:

    猜你喜欢
    • 2016-02-04
    • 1970-01-01
    • 2017-02-15
    • 2017-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-14
    相关资源
    最近更新 更多