简体   繁体   English

Android使用RecyclerView滚动时列表可以容纳多少个项目

[英]Android How many items can a list fit while scrolling with RecyclerView

I have a simple recyclerView. 我有一个简单的recyclerView。 When scrolling, items are getting fetched from a Room Database and being added to the recycler's list. 滚动时,将从“房间数据库”中获取项目并将其添加到回收者的列表中。

I wondering how many items can be added before throws OOM? 我想知道在抛出OOM之前可以添加多少个项目?

Is there any way to control this? 有什么办法可以控制吗? Example: In instagram's search section you cant scroll down forever right? 示例:在instagram的搜索部分中,您无法永远向下滚动吗?

RecyclerView creates limited number of views, then populate them by your data. RecyclerView创建数量有限的视图,然后根据您的数据进行填充。 So, there is no limits to show the items until some problems happened like reaching the Integer MAX_VALUE (because of containing list position), etc... 因此,直到出现某些问题(例如达到Integer MAX_VALUE(由于包含列表位置)等)之前,没有限制显示项目。

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

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