【问题标题】:Nativescript Angular - Cannot trigger itemSelected on the first item on a RadListViewNativescript Angular - 无法在 RadListView 上的第一项上触发 itemSelected
【发布时间】:2021-02-28 03:34:29
【问题描述】:

请帮忙! 我无法在 IOS 上单击 radlistview 中的第一项(未触发 onItemSelected),但它在 android 上运行良好。

我的代码:

<GridLayout class="p-x-10">
  <RadListView
    class="users"
    loadOnDemandMode="Auto"
    pullToRefresh="true"
    selectionBehavior="Press"
    [items]="userPaginator.docs"
    (itemSelected)="onItemSelected($event)"
    (loadMoreDataRequested)="onLoadMoreItemsRequested($event)"
    (pullToRefreshInitiated)="onPullToRefreshInitiated($event)"
    >
    <ng-template tkListItemTemplate let-item="item">
      <StackLayout orientation="vertical" class="users__card">
        <Label class="users__card-name" [text]="item.name"></Label>
        <Label class="users__card-username" [text]="item.username"></Label>
        <Label class="users__card-userId" [text]="item.userId"></Label>
        <Label class="users__card-email" [text]="item.email"></Label>
        <Label class="users__card-phone" [text]="item.phone"></Label>
      </StackLayout>
    </ng-template>

  </RadListView>
  <ActivityIndicator
    rowSpan="1"
    [busy]="isPageLoading"
    [visibility]="isPageLoading ? 'visible' : 'collapse'"
    horizontalAlignment="center"></ActivityIndicator>

</GridLayout>

【问题讨论】:

    标签: nativescript-angular


    【解决方案1】:

    你可以使用 StackLayout 的点击事件来代替 OnItemSelected

    <StackLayout orientation="vertical" class="users__card" (tap)="onItemSelected($event)">
    

    【讨论】:

      猜你喜欢
      • 2020-06-11
      • 1970-01-01
      • 2017-06-22
      • 1970-01-01
      • 2016-10-28
      • 2018-06-13
      • 1970-01-01
      • 2019-09-03
      • 2016-03-03
      相关资源
      最近更新 更多