简体   繁体   中英

Scrolling wrapped text in an ion-list

I've been working on a list with scrollable content, but after several tests I found that the scollbar is considering only the image but not the wrapped text for item size. This causes truncating content at the bottom of the page.

Here's my code:

<ion-content ng-controller="categoriesCtrl" ng-switch on="categories.length > 0" has-bouncing="false">
  <ion-refresher on-refresh="updateCategories()">
  </ion-refresher>
  <div ng-switch-when="true">
    <ion-list type="card">
      <a class="item item-thumbnail-right item-text-wrap" href="#" ng-repeat="category in categories">
        <img ng-src="{{category.photo}}" />
        <h2>{{category.name}}</h2>
        <p class="item-text-wrap">{{category.description}}</p>
      </a>
    </ion-list>
  </div>
</ion-content>

this is what I got, cannot scroll any further

截断项目演示

Solutions?

It appears you're using a combination of the <ion-list> directive with the list CSS elements. Try using the <ion-list> with <ion-item> directive .

<ion-list>
  <ion-item class="item-text-wrap item-thumbnail-right">
    <img ng-src="{{category.photo}}" />
    <h2>Name</h2>
    <p>{{description}}</p>
  </ion-item>
  <ion-item class="item-text-wrap item-thumbnail-right">
    <img ng-src="{{category.photo}}" />
    <h2>Name</h2>
    <p>{{description}}</p>
  </ion-item>
</ion-list>

Here's the working demo .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM