[英]How to display images in recycler view with different sizes
i want to display images in Recycler View 我想在Recycler View中显示图像
You can see images have no fixed height and width. 您可以看到图像没有固定的高度和宽度。 just randomly shown in different sizes. 只是随机显示不同的大小。 i have considered StaggeredLayoutManager
for recyclerview
but the problem with that we have to show vertically or horizontally with fixed height in that. 我已经考虑使用StaggeredLayoutManager
进行recyclerview
但问题是我们必须垂直或水平显示固定高度。 Can anyone help? 有人可以帮忙吗?
在您的recyclerview适配器中创建不同类型的视图,并根据图像类型对视图进行充气
You can cerate different view holder for different position or item of different sizes. 您可以为不同的位置或不同尺寸的项目设置不同的视图持有者。 Please take a reference from here : How to create RecyclerView with multiple view type? 请从这里参考: 如何创建具有多种视图类型的RecyclerView?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.