UISlider 在停止更改值后评估结果
我有一个连续的 UI 滑块。我在值发生变化时获取该值,并使用它来计算放入文本字段的值。
我将值更改出口链接到执行计算并且工作正常的方法,但我还想要一种在用户抬起滑块后触发的方法,该方法有效地对最终设置值进行一次评估。
我尝试连接 did end on exit 方法和其他可用的方法。
I have a UI slider that is continuous. I take the value as it changes and use it to calculate a value that i put into a textfield.
I have the value changed outlet linked to the method that does the calculation and that works ok but i also want a method to fire once the user lifts off the slider that effectively gives a once time evaluation of the final set value.
I have tried connecting the the did end on exit method and others available .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 UISlider 的 UIControlEventTouchUpInside 事件,如有必要,使用 UIControlEventTouchUpOutside 事件。当用户将手指从 UISlider 上移开时,将触发这些事件。调用哪一个将取决于手指抬起时是在 UISlider 的边界之内还是之外。
Use the UISlider's UIControlEventTouchUpInside event and, if necessary the UIControlEventTouchUpOutside event. These events will be triggered when the user lifts their finger off the UISlider. Which one is called will depend on whether the finger is inside or outside the bounds of the UISlider when it is lifted.