[在loadOnDemandMode="auto"
中使用RadListView时,如何更改iOS中活动指示器的背景颜色?在Android平台中,它似乎与背景色相同,但在iOS中,它是白色
[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;
});
}