Nativescript RadListView标头消失(Android)

时间:2018-11-04 23:19:57

标签: nativescript nativescript-angular nativescript-telerik-ui

我正在使用RadListView尝试使用标头功能。如果我尝试在标题内使用StackLayout,则在加载内容后它会消失。但是,如果标头是一个元素(例如Label),则可以正常工作。该问题仅出现在Android上。

<GridLayout>
        <RadListView [items]="products">
                <ng-template tkListItemTemplate let-item="item">
                        <StackLayout orientation="vertical">
                                <Label class="nameLabel" text="test title"></Label>
                                <Label class="descriptionLabel" text="test description"></Label>
                        </StackLayout>
                </ng-template>
                <ng-template tkListViewHeader>
                        <StackLayout orientation="vertical">
                                <Label text="This is header row 1"></Label>
                                <Label text="This is header row 2"></Label>
                        </StackLayout>
                </ng-template>
        </RadListView>
</GridLayout>

加载前:

加载后:

1 个答案:

答案 0 :(得分:0)

我发现了问题。我的列表数据源不是Observable。因此,我猜想它在初始化后将动态内容直接加载到普通数组中是行不通的。