nativescript - 使用gridview时遇到“onMeasure()没有通过调用setMeasuredDimension()设置测量尺寸”错误
问题描述
我在我的应用程序中使用 gridview 插件。(https://market.nativescript.org/plugins/nativescript-grid-view)
在我的参考文献中添加以下行后,我遇到了一个错误:
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
/// <reference path="./node_modules/tns-platform-declarations/android.d.ts" />
错误:
file:///app/tns_modules/tns-core-modules/ui/core/view/view.js:58:124: JS ERROR 错误: onMeasure() 没有通过调用 setMeasuredDimension() Label(174) 设置测量尺寸)
这是代码片段
<GridLayout class="page">
<GridView [items]="watches" colWidth="49%" rowHeight="280">
<ng-template let-item="item">
<FlexboxLayout class="watch-item">
<Label text="Hi"></Label>
</FlexboxLayout>
</ng-template>
</GridView>
</GridLayout>
我尝试了不同的布局,但错误是一样的。
我想知道如何解决这个问题?
谢谢
解决方案
与 Angular 一起使用时,插件似乎是一个已知问题。
推荐阅读
- sql - 比较 SQL Server 中包含时间部分的日期
- python - 如何在 python 上制作网格(使用 matplotlib 或其他库)
- c# - 如何从控制器中的 SelectList 设置属性值
- javascript - 如何使用此 JSON 对象填充多选字段以被选择并插入到另一个对象中?
- php - 如何在 php 循环中正确运行 jquery 代码
- python - Numpy 数组就地更新或隐式复制
- java - 在控制器中映射 URL(从相关表中删除数据) Spring Boot
- javascript - Bootstrap 将样式应用于表单中不需要的输入。
- delphi - TidHTTP Request 在 Fiddler 运行时有效,但在关闭时无效
- grpc - gPRC如何将数组数据从服务器发送到客户端[gPRC + Node.js]