Nativescript RadListView 标头消失(Android)

问题描述 投票:0回答:2

我正在使用 RadListView 尝试使用标题功能。如果我尝试在标题内使用 StackLayout,它会在加载内容后消失。但如果标题是一个元素(例如标签),它就可以正常工作。该问题仅出现在 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>

加载前:

加载后:

nativescript nativescript-angular nativescript-telerik-ui
2个回答
0
投票

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


0
投票

在加载任何数据之前,您必须设置 RadList 的高度

© www.soinside.com 2019 - 2024. All rights reserved.