观察UISlider的价值 - iPhone KVO [英] Observing a UISlider's value - iPhone KVO

查看:301
本文介绍了观察UISlider的价值 - iPhone KVO的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

默认情况下,当我观察到UISlider的值,它只更新一次,当滑块被点击,不是连续,即使是滑块的设置。
是否有办法获得滑块的连续值更改?

By default, when I observe the value of a UISlider, it only updates once, when the slider is clicked, not continuously, even thought that is the slider's setting. Is there a way to get the continuous value change of the slider?

推荐答案

UIKit不主动支持KVO 。你可能会幸运,有些通知可能会通过通常的机制,但在大多数情况下,你不应该假设你可以使用KVO与任何UIKit类。

UIKit doesn't actively support KVO. You may be getting lucky in that some notifications may make it through the usual mechanisms, but for the most part you shouldn't assume you can use KVO with any UIKit class.

你应该通过UISlider的关联目标的动作方法获得你的连续事件。

You should instead get your continuous events through the UISlider's associated target's action method.

这篇关于观察UISlider的价值 - iPhone KVO的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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