RadListView loadOnDemandMode指示器背景色

时间:2018-12-30 15:43:58

标签: nativescript

将RadListView与loadOnDemandMode="auto"一起使用时,如何更改iOS中活动指示器的背景颜色?
在Android平台上,它看起来与背景颜色相同,但是在iOS上,它是白色

1 个答案:

答案 0 :(得分:0)

collectionView.visibleCells返回ExtendedLoadOnDemandCell作为其第一个元素,其中包含在loadOnDemand模式下使用的活动指示符。

下面是将活动指示器的颜色和backgroundColor设置为透明的代码

this.listview.nativeView.collectionView.visibleCells[0].activityIndicator.color = UIColor.clearColor;
this.listview.nativeView.collectionView.visibleCells[0].activityIndicator.backgroundColor = UIColor.clearColor;

tkListLoadOnDemandTemplate的已加载事件上进行设置。您可能还需要将其包装在setTimeout中,以防它触发得太早。

<GridLayout *tkListLoadOnDemandTemplate (loaded)="onLoadOnDemandLoaded($event)"></GridLayout>
onLoadOnDemandLoaded(args) {
  setTimeout(() => {
    this.listview.nativeView.collectionView.visibleCells[0].activityIndicator.color = UIColor.clearColor;
    this.listview.nativeView.collectionView.visibleCells[0].activityIndicator.backgroundColor = UIColor.clearColor;
  });
}