当我尝试围绕Google在其开发者社区支持中使用的逻辑围绕我的大脑时,它使我疯狂地开始拉扯我的头发(幸运地我是秃顶)。 我的意思是人们会期望谷歌正在间接提倡作为其根容器的小部件NSV,可以与其他几乎普遍使用的小部件recyclerview一起使用。那么NestedScrollView和Recyclerview一起使用的判决是什么?
这是如何跨越他们的想法超越了我。在API22令我们感到困惑之后,谷歌仍然没有解决它们之间的问题。
我很抱歉浪费非生产性的咆哮。
我有什么
我猜nothign将是新来的,因为几乎每个人都用甩挣扎里面nestedscrollview得到了相同的设置来完成着想I.然而,这是我的观点的支架。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical">
<android.support.design.widget.CoordinatorLayout
tools:ignore="RtlHardcoded">
<android.support.design.widget.AppBarLayout
>
<android.support.design.widget.CollapsingToolbarLayout
>
<View
></View>
<android.support.v7.widget.Toolbar
android:id="@id/tool_bar"
/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="100dp" />
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"></android.support.v7.widget.RecyclerView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
<com.roughike.bottombar.BottomBar
android:id="@+id/bottom_navigation_bar"
/>
</android.support.design.widget.CoordinatorLayout>
</LinearLayout>
问题 简单! 。 RV应该WAI。当它停下来时,它应该抛起并停下来。在NSV的视野之下,虽然RV不会飞起来,但只要手指抬起,它就会停下来。
思考
哪这么短的时间在我手上(客户端总是这样),以及所涉及的recyclerview和NSV滚动过程中,我实在是没有动力多拿一支蜡烛,走进之间可能残酷的技术性下面的阴影。
然而我跑出了选项,并控制+点击RV。有人说这个问题与布局经理有关。
我会在这里发布,如果我希望拿出一个解决方案。如果您有任何问题,请在这里发表您的想法。
recyclerView.setHasFixedSize(false);我按照你的建议尝试了这个。工作它没有。 :| –
你添加了nestedScrollingEnabled = true吗? –
nestedscrollingenabled是一个非常差的方法。它将完整的数据集加载到RV中并杀死回收。如果我在数据集中有一千行,它会加载所有这些行。这也会导致无尽的滚动问题。不幸的是,它不是一个选项 –