简体   繁体   English

如何制作自定义形状的 Recycler View?

[英]How to make a custom-shaped Recycler View?

I need to make a recycler view whose elements will wrap around the ImageView (like this: https://imgur.com/a/7NpCHri ).我需要制作一个回收器视图,其元素将环绕 ImageView(如下所示: https://imgur.com/a/7NpCHri )。 Is there a way to implement this?有没有办法实现这个?

You can create adapter with GridLayoutManager and for items with indexes 6, 7, 10, 11 make empty transparent views.您可以使用 GridLayoutManager 创建适配器,并为索引为 6、7、10、11 的项目创建空透明视图。 But as it were said in comment it is not appropriate use of RV.但正如评论中所说,使用 RV 是不合适的。 Maybe it is better to stick with ordinary buttons, or make a custom composite view group.也许最好还是坚持使用普通按钮,或者制作一个自定义的复合视图组。

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

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