UIView animateWithDuration 不适用于 UISlider [英] UIView animateWithDuration not working with UISlider

查看:28
本文介绍了UIView animateWithDuration 不适用于 UISlider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望滑块缓慢设置值,为此我使用此代码

I want the slider to set value slowly and for that I am using this code

    [UIView animateWithDuration:2.0 animations:^{
         [self.slider setValue:(float)val];
    }];

但这行不通.请帮帮我.

But this is not working. Please help me out.

推荐答案

使用 [self.slider setValue:(float)val animation:YES]; 代替.

这篇关于UIView animateWithDuration 不适用于 UISlider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆