Remove ion item divider

后端 未结 8 1687
长情又很酷
长情又很酷 2020-12-28 13:34

How I can remove divider? I have the following code to show 4 items in a row:


    

        
相关标签:
8条回答
  • 2020-12-28 14:04

    I tried with no-line but it didn't work in ionic 4

    Only this work for me in ionic 4 :

    <ion-item lines="none"> </ion-item>
    
    <ion-list>
     <ion-item lines="none" button detail *ngFor="let note of notesService.notes">
          <ion-label>{{ note.title }}</ion-label>
        </ion-item>
    </ion-list>
    
    0 讨论(0)
  • 2020-12-28 14:07

    For whatever reason this didn't work for me. But having lines="none" worked great.

    For ionic v4

    <ion-item lines="none"> </ion-item>

    Pulled from ionic docs... https://ionicframework.com/docs/api/list

    0 讨论(0)
  • 2020-12-28 14:11

    Apply this for Ionic V4. Really it will work.. Happy coding

    <ion-item lines="none">
    </ion-item>
    
    0 讨论(0)
  • 2020-12-28 14:12

    For ionic v4, you should use the lines property:

    <ion-row ion-list>
        <ion-col width-25 *ngFor="let player of players">
             <ion-item lines="none" color="dark">
                  <ion-avatar item-left>
                      <img [src]="photo" class="img img-circle"/>
                  </ion-avatar>
                  {{user.name}}
             </ion-item>
        </ion-col>
    </ion-row>
    
    0 讨论(0)
  • 2020-12-28 14:12

    I am on ionic 4, and lines="none" somethimes don't work. So I use this line.

    ion-list:not(.list-lines-none) ion-item::before{
        border-width: 0 !important;
    }
    

    And this is my ionItem example. (It has hidden error property also)

    <IonItem lines="none" detail={false}>
        <IonIcon
            className="w-40 h-40 float-left"
            src="/assets/icon/store-black.svg"
        />
        <IonLabel className="flex flex-col ml-10">
            <h5 className="text-base font-bold m-0 ">Lorem ipsum </h5>
            <span className="text-sm leading-tight">Kratki opis</span>
        </IonLabel>
        <IonIcon
            className=" absolute top-50 right-30 w-15 h-15"
            src="/assets/icon/arrow-right.svg"
        />
    </IonItem>
    
    0 讨论(0)
  • 2020-12-28 14:13

    use no-lines

    <ion-row ion-list>
        <ion-col width-25 *ngFor="let player of players">
             <ion-item no-lines color="dark"><!-- here -->
                  <ion-avatar item-left>
                      <img [src]="photo" class="img img-circle"/>
                  </ion-avatar>
                  {{user.name}}
             </ion-item>
         </ion-col>
    </ion-row>
    
    0 讨论(0)
提交回复
热议问题