【发布时间】:2019-09-08 18:35:34
【问题描述】:
我有一个包含很多帖子的回收站视图。当我滚动 recyclerview 时,我的框架布局不滚动。它像导航栏一样固定。 我希望它像 recyclerview 的一部分一样滚动。 这是我的布局:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#ffffff"
tools:context=".HomePageFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:id="@+id/status_frame"
android:layout_width="match_parent"
android:layout_height="wrap_content"></FrameLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
></androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
</ScrollView>
我尝试使用nestedScrollView,但它添加了额外的空帖子。我不知道为什么。
我的 frameLayout 是状态部分。这是另一个recyclerview本身。滚动帖子时,状态部分不会滚动。
【问题讨论】:
-
任何截图都会有所帮助
-
你所说的状态部分是什么意思?死水池圈?
-
是的,那些死胡同。他们在帖子的顶部
-
你想让他们随着帖子垂直滚动吗?
-
是的,就是这样
标签: android android-recyclerview scrollview