我在NestedScrollView
裏面加了RecyclerView
。基本上我想要RecyclerView與其他視圖滾動。我面臨的問題是,對於一小部分數據,它工作正常,但對於大量數據(200條),只要我啓動活動,就會凍結大約3-5秒,然後加載。我刪除了NestedScrollView
,它的工作完美無瑕,但它並沒有爲我提供我想要的行爲。Recycler查看加載非常緩慢的大數據時內部NestedScrollView
(對於額外的信息,我加載從SQLite數據庫中的數據。有一個在滾動沒有問題的,因爲它是光滑的。唯一的問題是活性凍結了一會兒)
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<... Some other Views ...>
<android.support.v7.widget.RecyclerView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical">
</android.support.v7.widget.RecyclerView>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
嘗試'recyclerView.setNestedScrollingEnabled(false);' –
是的我已經試過了,它不工作,正如我所說的,滾動沒有問題 –
請顯示您的java代碼,從數據庫中提取數據的位置您正在將這些數據填充到您的佈局中。 –