Ksenia Asked:2020-08-13 17:54:56 +0000 UTC2020-08-13 17:54:56 +0000 UTC 2020-08-13 17:54:56 +0000 UTC 如何将水平 RecyclerView 对齐到底部? 772 如何将水平 RecyclerView 对齐到底部?例如,我有一个带有 LinearLayoutManager 的水平 RecyclerView,如下所示: 但是,我希望所有 RecyclerView 项目都与底线对齐,如下所示: 有没有办法做到这一点? android 1 个回答 Voted Best Answer Sergei Buvaka 2020-08-13T18:30:05Z2020-08-13T18:30:05Z 为标记中的每个项目创建一个容器,如下所示: <androidx.constraintlayout.widget.ConstraintLayout 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"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout> 底线是容器本身应该具有列表中最大视图的大小,并且在其中将是视图本身,它将简单地附加到该容器的底部并从下到上缩放。
为标记中的每个项目创建一个容器,如下所示:
底线是容器本身应该具有列表中最大视图的大小,并且在其中将是视图本身,它将简单地附加到该容器的底部并从下到上缩放。