【问题标题】:Ion segment button styling离子段按钮样式
【发布时间】:2021-04-19 16:47:09
【问题描述】:

我为 Android 设备使用离子段按钮创建了一个离子段标签。下面是我的代码

<ion-content>
  <ion-segment color="primary">
    <ion-segment-button value="call">
      <ion-label>Call</ion-label>
    </ion-segment-button>
    <ion-segment-button value="favorite">
      <ion-label>Favorite</ion-label>
    </ion-segment-button>
    <ion-segment-button value="map">
      <ion-label>Map</ion-label>
    </ion-segment-button>
  </ion-segment>
</ion-content>

下面是我得到的输出视图图像,

但我希望输出类似于下图,点击时标签背景颜色。

请帮助我如何在安卓设备上获得它。

【问题讨论】:

    标签: ionic-framework


    【解决方案1】:

    您显示的是默认的 iOS 段。

    将属性 mode="ios" 添加到 ion-segment。

    您可以在 ion-segment-button 上应用样式。

    文档:SegmentSegment Button

    <ion-segment mode="ios">
        <ion-segment-button value="one" checked>
            One
        </ion-segment-button>
        <ion-segment-button>
            Two
        </ion-segment-button>
        <ion-segment-button>
            Three
        </ion-segment-button>
    </ion-segment>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-09-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-02
      相关资源
      最近更新 更多