简体   繁体   English

Ionic2离子列表,你如何删除底部边框?

[英]Ionic2 ion-list, how do you remove the bottom borders?

I'm using the no-lines designation in the ion-list tag which removes the lines between each ion-item but it leaves the bottom borders in place which I would like to remove. 我在离子列表标签中使用了无线标识,它删除了每个离子项之间的线条,但它留下了我想要删除的底部边框。

removeBorder.html removeBorder.html

<ion-content>
  <ion-list no-lines>
    <ion-item-sliding *ngFor="let message of Messages">
      <ion-item>
        <ion-thumbnail item-left>
          <img src="{{message.logo._url}}">
        </ion-thumbnail>
        <ion-item class="blurb" text-wrap  detail-push>{{message.message}}</ion-item>
      </ion-item>
      <ion-item-options side="left">
        <button ion-button color="custom" (click)="more()">More</button>
      </ion-item-options>
      <ion-item-options side="right">
        <button ion-button color="light" (click)="other()">Other</button>
      </ion-item-options>
    </ion-item-sliding>
  </ion-list>
</ion-content>

removeBorder.scss removeBorder.scss

.blurb {
 font-size: 11px;
 font-family: 'Arial', sans-serif;
 color: #585b60;
 text-transform: none;
 text-overflow: visible;
}

Here you can see the top line which is the item border from the bottom of the message that I'd like removed and the list border which I'd also like removed and the bottom line is the top of the tabs bar which is exactly where it needs to be. 在这里你可以看到顶行是我想要移除的消息底部的项目边框和我也想删除的列表边框,底行是标签栏的顶部,这正好在哪里它需要。 There are no other lines in the list save for these two bottom borders. 除了这两个底部边框之外,列表中没有其他行。

在此输入图像描述

For ionic Version 4,You can use below code: 对于离子版本4,您可以使用以下代码:

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

在此输入图像描述

在此输入图像描述

I had the same issue when I use ion-item-sliding , I removed it by adding below into my XXXPage scss: 当我使用ion-item-sliding ,我遇到了同样的问题,我通过在下面添加到我的XXXPage scss中删除它:

  .list-ios > .item-block:last-child, .list-ios > .item-wrapper:last-child .item-block {
    border-bottom: 0 solid #c8c7cc !important;
  }

i just tried this on a new page on my app: 我只是在我的应用程序的新页面上尝试了这个:

<ion-list no-lines>
  <ion-item-sliding>
    <ion-item>
      <ion-thumbnail item-left>
        <img src="">
      </ion-thumbnail>
      <ion-item text-wrap></ion-item>
    </ion-item>
    <ion-item-options side="left">
      <button ion-button color="custom">More</button>
    </ion-item-options>
    <ion-item-options side="right">
      <button ion-button color="light">Other</button>
    </ion-item-options>
  </ion-item-sliding>
</ion-list>

And there is no lines. 而且没有线条。 在此输入图像描述

I think your template is right, no-lines is working, maybe some of the attr that i delete or classes?? 我认为你的模板是正确的,没有行是工作,也许我删除或类的一些attr?

Hope this help you 希望这对你有所帮助

I have the same issue before, and I found a solution to hide the line in the bottom. 我之前有同样的问题,我找到了一个隐藏底部线的解决方案。 This issue may be caught by ion-item-sliding . ion-item-sliding可能会捕获此问题。

You can try this: 你可以试试这个:

<ion-list no-lines style="border: none;">
    //...
</ion-list>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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