flutter - Flutter 中 RecyclerView 的替代方案是什么?
问题描述
什么是颤振中回收视图的替代方法我尝试使用此代码但是如何在颤动中使用列表视图小部件进行动画处理
这是有效的吗?
ListView(
children: <Widget>[
ListTile(
leading: Icon(Icons.map),
title: Text('Map'),
),
ListTile(
leading: Icon(Icons.photo_album),
title: Text('Album'),
),
ListTile(
leading: Icon(Icons.phone),
title: Text('Phone'),
),
],
);
解决方案
ListView
:
通常这应该与少数孩子一起使用,因为 List 也会在列表中构造不可见的元素,并且大量元素可能会导致效率低下。
ListView.builder()
:
列表项是惰性构建的,这意味着仅构建特定数量的列表项,当用户向前滚动时,较早的列表项将被销毁。
更多信息在这里。
推荐阅读
- c# - 无法在 Mozilla 中截取突出显示的元素,但可以在 Chrome 中截取突出显示的元素
- java - 阔叶安装时无法在mysql中创建表
- javascript - 我可以为我的子子菜单创建一个新区域吗?
- machine-learning - 如何处理机器学习中的偏见特征(日期)
- http - 这个请求应该是 GET 还是 POST?
- sql - 为什么两个非常相似的 Hive 查询返回不同的结果(其中一个显然是错误的)?
- javascript - 当 DOM XSS 对映 XSS 时,黑客会接近吗?
- excel - 在 Excel 中反映返回日期和延期日期
- php - 如何使用数据库中的一些数据对 python http 请求进行 php 服务器脚本响应
- dependencies - 如何在 UML 用例图中根据主要参与者的角色建模不同的外部系统?