首页 > 解决方案 > 如何去除离子 4 段指示器(底线)?请告诉我

问题描述

  .segment-button-indicator {
        -ms-flex-item-align: end;
        align-self: flex-end;
        width: 100%;
        height: 2px;
        background-color: var(--indicator-color);
        opacity: 1;
    }

我是混合应用程序开发的新手。我必须使用离子段。有 ion-segment-indicator 指示离子段的底线,所以我需要将其删除。我可以从这些默认 css 代码中删除,但是当我尝试自定义它时并没有删除

标签: htmlcsstypescriptionic-frameworksass

解决方案


您无法删除它,但可以通过将其颜色设置为透明来隐藏它。

theme/variables.scss添加这个:

ion-segment-button {
  --indicator-color: transparent !important;
  --indicator-color-checked: transparent !important;
}

推荐阅读