RecyclerView 设置多列显示

今天写代码的时候,就怎么都想不起来spanCount这个参数了,只好看原来的老代码。那就本着好脑子不如烂笔头的思想记下,能帮人最好。

 <android.support.v7.widget.RecyclerView
            android:layout_width="match_parent"
            app:layout_constraintTop_toBottomOf="@id/fgV3"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layoutManager="android.support.v7.widget.GridLayoutManager"设置管理器
            app:spanCount="2" 设置显示一行几列
            android:layout_height="0dp">

猜你喜欢

转载自blog.csdn.net/LPL0129/article/details/89336933