简体   繁体   English

Android-如何在回收站视图内使用回收站视图

[英]Android - How to use recycler view inside recycler view

how can i create this type of view in android there row and column ,both sides data will be coming from api. 我如何在android中创建这种类型的视图呢?行和列,双方数据都将来自api。 what component of android studio , i have to use it ? 我必须使用android studio的什么组件? can anyone please help me , i have to color also the fix row and column. 谁能帮我,我也必须给行和列上色。

i tried with recycler view inside recycler view but its didn't working. 我尝试了在回收站视图中使用回收站视图,但是它没有工作。

                      <android.support.v7.widget.RecyclerView
                        android:id="@+id/recyclerView"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal" />

图片在这里...

Take a look at GridLayout . 看一下GridLayout It have rows and columns and may be that you are looking for. 它具有行和列,可能是您要寻找的。

use GridLayoutManager 使用GridLayoutManager

recyclerView.setLayoutManager(new GridLayoutManager(context, columnCount));

If you want 4 columns, replace columnCount with 4. 如果要4列,请用4替换columnCount。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM