How to add underline under selected segment in ionic?

0

Issue

I would like to show underline under selected segment.

My html code is :

 <ion-segment value="All">
    <ion-segment-button value="All" class="mysegment">
      <ion-label>All</ion-label>
    </ion-segment-button>
    <ion-segment-button value="Favorite" class="mysegment">
      <ion-label>Favorite</ion-label>
    </ion-segment-button>
  </ion-segment>
                     

My scss code is :

 .mysegment {
       color: white;
 }
         

Solution

It can be done using mode="md" in ion-segment, as follow:

     <ion-segment value="All" mode="md">  

Answered By – H S Progr

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More