android - Why getItemCount() called multiple times in recycleView?
问题描述
Pls suggest. I am unable to find anything written in developer.android.com about this. If anyone help is highly appreciable.
Thanks in advance.
解决方案
getItemCount() - 返回适配器中当前可用的项目数
此方法返回包含您要显示的项目的集合的大小,如@CommonsWare 所说(完全正确)。
@Override
public int getItemCount() {
return listofitems.size();
}
为了给您搜索到的参考资料,请看这里:
希望有助于澄清。干杯:)
推荐阅读
- r - R中的正则表达式负后视案例
- printing - MFC:如何打印 CRichEditView 的内容?
- image - 如何在 ioslides 演示文稿中永久嵌入图像?
- mysql - 创建由子查询组成的表的视图时出错?
- angular - 如何访问 HttpErrorResponse 的特定属性?
- mui-datatable - 如何展开 MUI-Datatables 中的单元格以显示其他内容?
- ruby-on-rails - Ruby 服务器端 Websocket 客户端
- woocommerce - WooCommerce 产品提要 Google 商家中心
- html - 我如何在我的导航栏上添加一个半透明的背景,同时在我的整个页面上有一个蓝色背景
- sql - F# 中的插值字符串