listview - Nativescript 生成的列表视图
问题描述
我正在尝试取自https://docs.nativescript.org/ui/components/list-view的示例的列表视图,但它只创建一个项目;我认为这里不起作用(listViewArray 有六个项目):
listView.on(ListView.itemLoadingEvent, (args) => {
if (!args.view) {
// Create label if it is not already created.
args.view = new Label();
args.view.className = "list-group-item";
}
(args.view).text = listViewArray.getItem(args.index).title; (
});
除此之外,我使用的示例与 GitHub 上公开的示例之间存在差异。
此外,该应用程序在 <page 令牌中公开了两个事件:
<Page loaded="onPageLoaded"
navigatingTo="onNavigatingTo"
xmlns:df="nativescript-ui-dataform"
xmlns="http://schemas.nativescript.org/tns.xsd">
但它只执行navigatingTo事件。
谢谢
解决方案
推荐阅读
- python - 如何在python中对存储xy坐标的二维数组进行排序?
- node.js - 如何从函数中的 url 将文件上传到 Firebase Storage
- serialization - 原因:java.lang.NoClassDefFoundError:自 6.0.0 以来无法初始化类 io.confluent.kafka.serializers.KafkaAvroSerializerConfig
- python - 两个日期之间的行数
- symfony - 如何升级 Webpack Encore 包?
- c++ - C++ 代码块 Linux 控制台菜单
- reactjs - 我的应用在调用登录时向 URL 添加了一个字符
- python - 根据时间条件修改值
- python - 使用 Python 在 MySQL 中向表中插入多列的正确语法
- python - 根据 startdate 和 enddate 之间的天数更新日期值