加载微调器未显示在无限滚动的底部

时间:2019-03-07 03:35:31

标签: html css ionic-framework

我想在无限滚动的底部添加加载微调器,但是在添加代码后,它却没有显示在底部。我对所有这些都很陌生。

Loading spinner somehow not showing up at the bottom of infinite scroll

<ion-infinite-scroll #infinite (ionInfinite)="getProducts($event)">
  <ion-infinite-scroll-content loadingSpinner="crescent" content="loading.."></ion-infinite-scroll-content>
</ion-infinite-scroll>

1 个答案:

答案 0 :(得分:0)

我在Ionic Spinner not showing up找到了这个。 不确定是否可以检查出来。

.my-spinner{
z-index: 99999999 !important;
position: absolute;
bottom:0px;
left:45%;
right:45%;
}


//template
<ion-infinite-scroll
    ng-if="!noMoreItemsAvailable"
    icon="ion-load-d"
    on-infinite="getpagenation()"
    distance="1%">
  </ion-infinite-scroll>

<div  ng-if="!noMoreItemsAvailable">
      <ion-spinner ng-show="ItemLoading" icon="ios" class="spinner spinner-ios my-spinner">
</div>



//js
$scope.getpagenation = function() {
        $scope.ItemLoading = true;
 //you can call services

 //have items
        $scope.ItemLoading = false;
 //no more items
        $scope.noMoreItemsAvailable = true;
        $scope.ItemLoading = false;
        $scope.$broadcast('scroll.infiniteScrollComplete');
}