相关疑难解决方法(0)

是否有与RecyclerView相同的addHeaderView?

我正在为回收者视图寻找相当于addHeaderView的东西.基本上我想要一个带有2个按钮的图像作为标题添加到列表视图中.是否有不同的方法将标题视图添加到回收站视图?指导的一个例子会很有帮助

编辑2(添加片段布局):

添加日志语句后,似乎getViewType只接收到0的位置.这导致onCreateView只加载一个布局:

10-26 16:32:53.766    5449-5449/co.testapp I/logger info? Adapter-> getItemCount: 5
10-26 16:32:53.766    5449-5449/co.testapp I/logger info? Adapter-> getItemCount: 5
10-26 16:32:53.766    5449-5449/co.testapp I/logger info? Adapter-> getItemCount: 5
10-26 16:32:53.766    5449-5449/co.testapp I/logger info? Adapter-> getItemCount: 5
10-26 16:32:53.766    5449-5449/co.testapp I/logger info? Adapter-> getItemCount: 5
10-26 16:32:53.766    5449-5449/co.testapp I/logger info? Adapter-> getItemCount: 5
10-26 16:32:53.766    5449-5449/co.testapp I/logger info? Adapter-> getItemCount: 5
10-26 16:32:53.766    5449-5449/co.testapp I/logger info? Adapter-> getItemCount: 5
10-26 16:32:53.766    5449-5449/co.testapp I/logger info? Adapter-> getItemCount: 5
10-26 16:32:53.766    5449-5449/co.testapp I/logger info? …
Run Code Online (Sandbox Code Playgroud)

android android-view android-recyclerview

279
推荐指数
10
解决办法
19万
查看次数

recycleview 与其他视图同时滚动

我有 recycleview 并且在顶部我有一个包含 textview 的视图。

我的问题是当向上滚动该文本视图时,它总是在顶部,只有回收视图滚动......我可以通过任何方式滚动两者。我不想在回收视图中使用视图类型,因为它已经用于其他目的

我的 XML

 <Rel layout>
 <text-view id="text"/>
 <recycle-view below="text" />
Run Code Online (Sandbox Code Playgroud)

那么 textview 如何随着回收视图滚动上下移动可以为此提供小片段

android scrollview android-recyclerview

3
推荐指数
1
解决办法
2898
查看次数