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