Recyclerview 在平板电脑横向模式下不向左滚动

问题描述

被这个问题困住了一段时间。我在一个带有水平布局管理器的框架内有这个 recyclerview。在手机上(纵向模式)可以在两侧(左右)滚动,但在平板电脑(横向模式)上只能向右滚动。顺便说一句,这是我的布局:

<androidx.constraintlayout.widget.ConstraintLayout
    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="@android:color/white"
    tools:context=".fragments.FragmentSubscriptionPlanList">

    <TextView
        android:id="@+id/tvTitle"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/_10sdp"
        android:layout_marginLeft="@dimen/_10sdp"
        android:layout_marginRight="@dimen/_10sdp"
        android:gravity="left"
        android:text="@string/change_plan"
        android:textSize="@dimen/_8ssp"
        app:layout_constraintTop_toTopOf="parent"
        tools:layout_editor_absoluteX="40dp" />

    <ProgressBar
        android:id="@+id/progressBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintTop_toTopOf="@id/rvSubscription"
        app:layout_constraintLeft_toLeftOf="@id/rvSubscription"
        app:layout_constraintRight_toRightOf="@id/rvSubscription"
        app:layout_constraintBottom_toBottomOf="@id/rvSubscription"/>

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/rvSubscription"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_marginTop="@dimen/_5sdp"
        android:paddingLeft="@dimen/_10sdp"
        android:paddingRight="@dimen/_10sdp"
        app:layout_constraintTop_toBottomOf="@id/tvTitle"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"/>

</androidx.constraintlayout.widget.ConstraintLayout>

Image link 因为 SO 还不允许我在此处嵌入图像:

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)