简体   繁体   中英

How can I remove the border from the last ion-item in an ion-list

I have a standard ion-list of ion-items which is dynamically populated.

<ion-list>
   <ion-item></ion-item>
   <ion-item></ion-item>
   <ion-item></ion-item>
</ion-list>

I would like to make it so that the standard border doesn't show up on the last ion-item in the list.

I've tried the following but it is just removing the border from every item.

 ion-list ion-item:last-child{
    --inner-border-width:0;
  }

Hello I had misunderstood your question and I thought you wanted to remove the bottom line.

<ng-container *ngFor="let item of itemList; let last = last;">
    <ion-item [lines]="last ? 'none' : 'full'">{{item.value}}</ion-item>
  </ng-container>

解决方案

Best regards and I hope this can help you

Can you try with this

ion-list ion-item:last-child{
  --border: none;
  --inner-border: none;
}

let me know if this works for you

and if it doesn't work, then send me a screenshot of the border that's wetting you

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