alskipp / ASValueTrackingSlider

A UISlider subclass that displays the slider value in a popup view
MIT License
1.84k stars 235 forks source link

how to adjust animation speed and how to always show values #34

Closed skywalkerlw closed 8 years ago

skywalkerlw commented 9 years ago

As titled, How to adjust animation speed and how to always show values?

Thanks

alskipp commented 9 years ago

To always show the popUpView you just need to call showPopUpViewAnimated:NO in ViewDidLoad.

I'm not certain what you are referring to regarding the animation speed? If you mean the color animation as you drag the slider, then you can specify the positions as follows:

[slider setPopUpViewAnimatedColors:@[[UIColor purpleColor], [UIColor greenColor], [UIColor orangeColor]]
                     withPositions:@[@0.0, @0.1, @1.0]];

The popUpView will be purple at the start, then green at 10%, then gradually become orange at 100%.