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 settingnumberOfDiscreteValues
.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
- Discrete dots scale slowly with track height. (#8744) (Robert Moore)
Multi-component changes
- Add API to control showing tick marks. (#8743) (Robert Moore)
- Add trackHeight property (#8740) (Bryan Oltman)
- Continuous sliders show tick marks. (#8745) (Robert Moore)