RadListView loadOnDemandMode指示器背景颜色

问题描述 投票:0回答:1

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

nativescript
1个回答
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;
  });
}
© www.soinside.com 2019 - 2024. All rights reserved.