RadListView上模板的限制

时间:2019-01-26 08:24:27

标签: nativescript

我有一个项目,我必须在我的RadListView中显示不同种类的项目,看来模板的总数约为17。
这会导致性能问题吗?有限制吗?

检查了documentation,似乎没有提到限制

这是我的RadListView html的示例,它现在包含8种类型的项目,每种都有自己的模板。应该还有9个回合模板:

<RadListView row="1" (itemLoading)="onItemLoading($event)" backgroundColor="rgba(0,0,0,0)" [itemTemplateSelector]="templateSelector" class="gridLayoutLayout" #myListView [items]="dataItems" 
selectionBehavior="None"
loadOnDemandMode="Auto" (loadMoreDataRequested)="onLoadMoreItemsRequested($event)"
>
    <ng-template tkListItemTemplate let-item="item">
        <StackLayout orientation="vertical">
            <Label text="Nothing" color="#000"></Label>
        </StackLayout>
    </ng-template>

    <ng-template tkTemplateKey="item_dummy" let-item="item" let-i="index">
        <GridLayout rows="*" columns="*" [height]="item.dummy_height">

        </GridLayout>
    </ng-template>             

    <ng-template tkTemplateKey="item_1" let-item="item" let-i="index">
        <GridLayout backgroundColor="rgba(0,0,0,0)" rows="*" columns="*"> 
            <feed-next-course [data]="item"></feed-next-course>
        </GridLayout>
    </ng-template>

    <ng-template tkTemplateKey="item_2" let-item="item" let-i="index">
        <GridLayout rows="*" columns="*">
            <feed-lesson-canceled [data]="item"></feed-lesson-canceled>
        </GridLayout>
    </ng-template>

    <ng-template tkTemplateKey="item_3" let-item="item" let-i="index">
        <GridLayout rows="*" columns="*">
            <feed-exam [data]="item"></feed-exam>
        </GridLayout>
    </ng-template>

    <ng-template tkTemplateKey="item_4" let-item="item" let-i="index">
        <GridLayout rows="*" columns="*">
            <feed-daily-schedule [data]="item"></feed-daily-schedule>
        </GridLayout>
    </ng-template>

    <ng-template tkTemplateKey="item_5" let-item="item" let-i="index">
        <GridLayout rows="*, auto" columns="*" class="feed-final-grade-cont" >   
            <feed-final-grade [data]="item"></feed-final-grade>
        </GridLayout>
    </ng-template>

    <ng-template tkTemplateKey="item_6" let-item="item" let-i="index">
        <GridLayout rows="*" columns="*">
            <feed-assignments-soon [data]="item"></feed-assignments-soon>
        </GridLayout>
    </ng-template>

</RadListView>

0 个答案:

没有答案