Important: make sure that the number of notches you end up with (minus the far-left one)divides equally into the length of sliderTrack. (In this example there are 20 notches, so the length of sliderTrack in pixels must be equally divisible by 20.) Otherwise, the last notch will not align with the slider.