微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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 举报,一经查实,本站将立刻删除。