ionic 2 how to customize ion-range?

ぃ、小莉子 提交于 2019-12-08 11:24:31

问题


in ionic 2, I want to customize the ion-range to be something like the following pic, or I should say : is there way to customize ion-range ?:

here is my code

    <ion-row>
      <ion-item>
         <ion-range min="500" max="1500" step="500" snaps="true" color="secondary"></ion-range>
      </ion-item>
    </ion-row>

and here is my range


回答1:


I did find out how to customize "ion-range", and here is what I built (I know it look not exact):

here are my steps:- 1- add these line of codes shown on picture to your src\theme\variables.scss

Note: there is many variables you can use to customize your ion-range in the folowing link ionic2 docs

2- here is my component code:

<ion-footer>
  <ion-toolbar>
    <ion-row>
      <ion-col width-33 text-left>
        Sedan
      </ion-col>
      <ion-col width-33 text-center>
        SUV
      </ion-col>
      <ion-col width-33 text-right>
        LUX
      </ion-col>
    </ion-row>
    <ion-range (ionChange)="selectCar()" min="500" max="1500" step="500" snaps="true" [(ngModel)]="value">
    </ion-range>

  </ion-toolbar>
 </ion-footer>


来源:https://stackoverflow.com/questions/40982792/ionic-2-how-to-customize-ion-range

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!