UISlider不在iOS7中animation

当我从iOS 6切换到iOS 7devise时,我注意到使用方法setValue:animated:不再为滑动过程设置animation。 有没有其他人遇到这个问题,并find了解决办法?

我只是添加一些代码来显示我没有做任何复杂的事情:

 //Variable declaration IBOutlet UISlider *s; //Connected in the .xib //Button pressed - (IBAction)buttonPressed:(id)sender { [s setValue:1 animated:YES]; } 

我按下button后直接跳到1。

向后兼容iOS 4解决scheme/解决方法:

 [UIView animateWithDuration:1.0 animations:^{ [_sliderTest setValue:0.90 animated:YES]; }]; 

看来,iOS 7不会animation,除非你指定这个块和animation:是。 iOS 6.0似乎忽略了animation块并执行自己的内部块。 有点奇怪 使用相同的代码指定持续时间为2.0来查看iOS 7animation的速度是iOS 6的两倍。