【问题标题】:My Recyclerview is inside in NestedScrollview it is working but scrolling is not working smoothly我的 Recyclerview 在 NestedScrollview 里面,它正在工作,但滚动不顺畅
【发布时间】:2018-02-21 07:25:15
【问题描述】:

我几乎尝试了所有方法,但没有获得完美的平滑滚动。请帮我。提前致谢

这是我的布局

<com.agribazaar.android.views.StickyScrollView style="@style/MatchParent">
       <LinearLayout
                android:id="@+id/ll_auctions"
                style="@style/MatchWidth"
                android:orientation="vertical">

                <android.support.v7.widget.RecyclerView
                    android:id="@+id/rv_upcoming"
                    style="@style/MatchWidth"
                    android:nestedScrollingEnabled="false"
                    android:padding="@dimen/m4dp" />


        </LinearLayout>

    </com.agribazaar.android.views.StickyScrollView>

【问题讨论】:

  • 可以分享你的代码吗?
  • 嵌套滚动有什么具体原因吗?
  • 是的,因为我也想在 recyclerview 中使用不同的视图
  • 您的 minSdkVersion 是什么?您正在测试哪个操作系统版本?
  • @Sachin Varma 我的 MinSdkVersion 是 15,我正在测试 25

标签: android android-recyclerview android-scrollview android-nestedscrollview nestedscrollview


【解决方案1】:

试试这个..

recyclerView.setNestedScrollingEnabled(false);

【讨论】:

  • 尝试硬编码线性布局的高度,如 { android:layout_height="200dp" }.. 如果它现在可以工作,那么你必须动态设置高度
猜你喜欢
  • 2019-05-25
  • 1970-01-01
  • 1970-01-01
  • 2015-12-14
  • 1970-01-01
  • 1970-01-01
  • 2016-01-13
相关资源
最近更新 更多