Material Components v93.5.0 Release Notes

Release Date: 2019-11-07 // over 4 years ago
  • ๐Ÿš€ This minor release introduces new APIs for Slider. The track height and the visibility of track tick marks can be customized.

    ๐Ÿ†• New features

    MDCSlider allows customization of the track height.

    Objective-C

    MDCSlider *slider = [[MDCSlider alloc] init];
    slider.trackHeight = 4;
    

    Swift

    let slider = MDCSlider()
    slider.trackHeight = 4
    

    MDCSlider also allows controlling the display of the track tick marks for continuous and discrete sliders. Setting this property disables the automatic conversion of a slider to "discrete" when setting numberOfDiscreteValues.

    Objective-C

    MDCSlider *slider = [[MDCSlider alloc] init];
    // Track tick marks are always shown. Remains a continuous slider.
    slider.trackTickVisibility = MDCSliderTrackTickVisibilityAlways;
    slider.minimumValue = 0;
    slider.maximumValue = 100;
    // Show tick marks at 0, 10, 20, ..., 100
    slider.numberOfDiscreteValues = 11;
    

    Swift

    let slider = MDCSlider()
    // Track tick marks are always shown. Remains a continuous slider.
    slider.trackTickVisibility = .always
    slider.minimumValue = 0;
    slider.maximumValue = 100;
    // Show tick marks at 0, 10, 20, ..., 100
    slider.numberOfDiscreteValues = 11;
    

    Component changes

    ThumbTrack

    Multi-component changes