【发布时间】:2018-12-10 19:34:00
【问题描述】:
我正在尝试使用 Angular 组件作为 RadListView 的模板。
<StackLayout>
<RadListView [items]="stories"
marginRight="-2"
separatorColor="transparent"
height="100%">
<ng-template tkListItemTemplate
let-story="item">
<NewsItem [story]="story"></NewsItem>
</ng-template>
</RadListView>
</StackLayout>
我收到以下错误。
file:///app/tns_modules/tns-core-modules/ui/core/view/view.js:57:124: JS ERROR 错误: onMeasure() 没有通过调用 setMeasuredDimension() 设置测量尺寸ProxyViewContainer(435)
【问题讨论】:
-
也许你的
NewsItem没有扩展CustomLayoutView。最简单的答案是在您的内容周围加上<StackLayout></StackLayout>。 -
hmm 我在
NewsItem的内容周围有一个StackLayout -
那不一样。
标签: ios nativescript nativescript-angular ios11.4