nativescript-angular - Nativescript Angular - 无法在 RadListView 的第一项上触发 itemSelected
问题描述
请帮忙!我无法在 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>
解决方案
而不是 OnItemSelected 您可以使用 StackLayout 的点击事件
<StackLayout orientation="vertical" class="users__card" (tap)="onItemSelected($event)">
推荐阅读
- android - 使用 listview 将数据从 Fragment 传递到 Activity
- mysql - 为什么简单地打开和保存文件(不做任何更改)会导致它在 MySQL LOAD 操作中变得不可读?
- svelte - Svelte 过渡方向开关问题
- laravel - Laravel 雄辩 - 如何在不创建模型的情况下从模型返回查询
- ios - 如何设置 MKMapView 区域以缩放到 userLocation 的准确性?
- opencv - 识别塔木德页面上的文本区域
- c# - 如何限制 Y 轴上的旋转以使玩家无法在 Unity 中旋转相机 360?
- sql - 如何在 SQL 的列中选择所有具有最大值的记录?
- java - Android studio - 在 textView 中更改字符串
- protocol-buffers - 协议缓冲区的 protoc 工具中的 -I 标志是什么?