水平滚动多行芯片组

这是我试图在android中进行的芯片组设计。我试着用三组芯片来做三行,但它们不能一起滚动。请提出解决方案,最好不要使用任何额外的库。
发布于 2022-07-08 05:51:12
如果您想使用RecyclerView实现这一点,那么只需将
android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.StaggeredGridLayoutManager"你最后的回收商视图代码是
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="120dp"
android:orientation="horizontal"
app:spanCount="3"
tools:itemCount="20"
app:layoutManager="androidx.recyclerview.widget.StaggeredGridLayoutManager"
tools:listitem="@layout/item" />https://stackoverflow.com/questions/71160193
复制相似问题