在我的Nativescript应用程序中,我显示了如下内容:
Item 1 of 10
Item 2 of 10
....
Item 10 of 10
为此,我提供了以下代码,这些代码可以正常工作
<ListView id="listView" items="{{ items }}" itemTemplateSelector="$index">
<ListView.itemTemplate>
<StackLayout>
<Label marginTop="20" textAlignment="center" fontWeight="Bold">
<Label.formattedText>
<FormattedString>
<FormattedString.spans>
<span text="Item " />
<span text="{{ $index + 1 }}"/>
<span text=" Of "/>
<span text="{{$parents['ListView'].items, $parents['ListView'].items.length }}" />
</FormattedString.spans>
</FormattedString>
</Label.formattedText>
</Label>
</StackLayout>
</ListView.itemTemplate>
</ListView>但是,当我发布https://docs.nativescript.org/angular/tooling/publishing/android-app-bundle上提到的Android App Bundle时,会产生如下内容:
Item 1 of [Object, Object]
Item 2 of [Object, Object]
....
Item 10 of [Object, Object]
有没有人知道如何处理这种情况,以及为什么它的功能与正常的不同?
发布于 2019-07-05 16:57:45
这是nativescript中的一个错误。我提出了一个问题,https://github.com/NativeScript/NativeScript/issues/7449也是如此。
https://stackoverflow.com/questions/54647899
复制相似问题