【问题标题】:What is wrong with this RecyclerView ViewHolder ScrollView layout that wont scroll这个不会滚动的 RecyclerView ViewHolder ScrollView 布局有什么问题
【发布时间】:2017-09-05 14:00:22
【问题描述】:

我的RecyclerView ViewHolder 布局我尝试使用android.widget.ScrollView 来滚动这样的内容:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="8dp"
    android:padding="4dp">

    <android.widget.ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        android:scrollbars="vertical">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <TextView
                android:id="@+id/title_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="10dp"
                android:text="SOME TEXT"
                android:textStyle="bold"/>

            <TextView
                android:id="@+id/descr_text"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/title_text"
                android:padding="10dp"
                android:text="SOME TEXT"
                android:textStyle="bold"/>

            <com.github.rahatarmanahmed.cpv.CircularProgressView
                android:id="@+id/progress_view"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:layout_centerInParent="true"
                android:visibility="gone"
                app:cpv_indeterminate="true"/>
        </RelativeLayout>
    </android.widget.ScrollView>
</LinearLayout>

问题是没有任何反应,我无法滚动它。 有什么建议可以吗?

【问题讨论】:

  • 你试过这些吗? thisthis
  • 您是否尝试在 dp 中设置高度?

标签: android android-recyclerview scrollview


【解决方案1】:

由于您的RecyclerView 已经在滚动,您可能需要NestedScrollview

【讨论】:

  • 谢谢你的权利。我滚动但真的很慢,我必须非常轻松而缓慢地滑动才能让滚动移动
猜你喜欢
  • 1970-01-01
  • 2023-03-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-09-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多