【问题标题】:Nativescript RadListView Header Disappearing (Android)Nativescript RadListView 标头消失(Android)
【发布时间】:2018-11-04 23:19:57
【问题描述】:

我正在使用 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>

加载前:

加载后:

【问题讨论】:

  • 直到你得到正确的回应:你能试着给标题设置一个高度为 100 吗?
  • 我无法使用文档中的相同示例重现该问题,除非使用 StackLayout 进行带有 2 个标签的标题视图。您能否尝试创建一个 Playground 示例,我们可以在其中看到问题。

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


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-13
    • 1970-01-01
    • 1970-01-01
    • 2017-03-10
    相关资源
    最近更新 更多