Nativescript RadListView Header Disappearing (Android)

248 views Asked by At

I am using RadListView trying to use the header feature. If I try to use a StackLayout inside the header it disappears after the content is loaded. But if the header is one element (such as a Label) it works fine. The issue only appears on 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>

Before Load:

After load:

2

There are 2 answers

0
keerl On BEST ANSWER

I found the issue. My data source for the list was not an Observable. So I guess it can't work with dynamic content being loaded directly into a normal array after it has been initialized.

0
Biggg Jimmm On

you have to set the height of the RadList Before loading any data