【发布时间】:2016-01-06 09:00:40
【问题描述】:
我在 Scrollview 中有 Recyclerview
<Scrollview
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:id="@+id/layoutStaticContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
//Static content.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp">
.
.
<LinearLayout>
//Dynamic content(newsfeed)
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</ScrollView>
现在在滚动时,layoutStaticContent 保持固定在顶部,而 recyclerview 内容在底部独立滚动。 如何滚动整个内容,即(layoutStaticContent + recyclerview 内容),使得只有 1 个滚动视图? 我也尝试用 Nestedscrollview 替换滚动视图,但没有成功。
【问题讨论】:
标签: android android-recyclerview nestedscrollview