[英]Is it possible to have a horizontal recyclerview inside a vertical recyclerview?
The main recyclerview
which is vertical recyclerview
shows all the deals in the layout垂直
recyclerview
器视图的主要recyclerview
器视图显示布局中的所有交易
But what I want to achieve is:但我想要实现的是:
I have attached the image of how i want the design to look.我附上了我希望设计外观的图像。
I have no clue on how to implement this.我不知道如何实现这一点。 But I have both the
recyclerview
working separately.但我有两个
recyclerview
分开工作。 Just not sure how to combine them.只是不知道如何组合它们。 I'm not even sure to code in the adapters or the main activity.
我什至不确定在适配器或主要活动中编写代码。 I have attached the image of the horizontal recyclerview adapter and vertical recyclerview adapter.
我附上了水平 recyclerview 适配器和垂直 recyclerview 适配器的图像。 Please help me by showing me how to implement this feature.
请通过向我展示如何实现此功能来帮助我。 Thanks
谢谢
For that purpose you can use NestedScrollView.为此,您可以使用 NestedScrollView。 NestedScrollView as the name suggests is used when there is a need for a scrolling view inside another scrolling view.
顾名思义,NestedScrollView 用于在另一个滚动视图中需要滚动视图时使用。
you can set like this:你可以这样设置:
android:nestedScrollingEnabled="true"
According to your requirement.根据你的要求。
I can't picture what exactly you want to achieve, but if you want to have vertical recyclerview which contains horizontal recyclerview, than you need to add adapter into adapter.我无法想象您到底想要实现什么,但是如果您想要拥有包含水平 recyclerview 的垂直 recyclerview,那么您需要将适配器添加到适配器中。
Item view that you use for vertical recyclerview should also contain recyclerview.用于垂直 recyclerview 的项目视图也应该包含 recyclerview。
This should be good reference on how to achieve it. 这应该是如何实现它的很好的参考。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.