Ionic pullToRefresh + lazyLoad + infinityScroll

时间:2016-01-08 16:38:22

标签: javascript android cordova ionic

当我使用Ionic pullToRefresh + lazyLoad(https://github.com/paveisistemas/ionic-image-lazy-load)+ infinityScroll页面开始运行非常缓慢。如果我滚动页面在android上滚动不稳定,动画是生涩的。如何改善页面性能? 这是我的模板:

<ion-content>
<ion-refresher
  pulling-text="Pull to refresh..."
  on-refresh="doRefresh()">
</ion-refresher>
<div>
  <div class="slider-box">
    <ion-slide-box>
      <ion-slide style="background-image: url({{item.image}});" ng-repeat="item in data.mainnews | orderBy:'-date'">
        <a href="#news/{{item.id}}">
          <p>{{item.title}} </p>
        </a>
      </ion-slide>
    </ion-slide-box>
    <div class="slide-prev" ng-click="prevSlide()"></div>
    <div class="slide-next" ng-click="nextSlide()"></div>
  </div>
</div>
<div class="content">
  <ion-list class="news-list">
    <ion-item collection-repeat="item in data.news | orderBy:'-date'" href="#news/{{item.id}}" class="item-thumbnail-left">
      <div class="item-image" style="background-image: url({{item.image}});"></div>
      <h2>{{item.title}}</h2>
      <p>{{item.short_content}}</p>
    </ion-item>
  </ion-list>
  <ion-infinite-scroll
    ng-if="!data.noMoreNews"
    on-infinite="loadMore()"
    distance="1%">
  </ion-infinite-scroll>

</div>

1 个答案:

答案 0 :(得分:0)

好的,我自己找到方法: https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview 我的应用程序大小从5mb增长到25,但所有动画和其他东西现在看起来好多了) 祝你好运)