ios - UIView animateWithDuration 不适用于 UISlider

标签 ios uislider uianimation

我想让 slider 缓慢地设置值,为此我正在使用这段代码

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

但这行不通。 请帮帮我。

最佳答案

改用[self.slider setValue:(float)val animated:YES];

关于ios - UIView animateWithDuration 不适用于 UISlider,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20539913/

相关文章:

ios - 根据计算值 [Swift] 使用 slider 更改文本字段中的值

iphone - 如何在iOS中将 slider 值转换为整数?

ios - 快速动画所有添加的 View alpha

ios - Xcode 添加子容器到容器 View

ios - 使用 Grand Central Dispatch (GCD) 时获取 OSSpinLockLock

ios - 隐蔽 3 级嵌套 json 到 Alamofire 参数

ios - 删除 UISlider 旋钮或快速更改图像

ios - 自动布局和动画

ios - 信息灯按钮动画

android - 我可以在大型项目中使用 SVG 代替 PNG 吗