【发布时间】:2014-11-14 15:18:36
【问题描述】:
我有一个 UISlider,它通过设置 CGRect 中的 x 值使 UIImageView 左右移动,使 UISlider.value。我想检测滑块何时停止,以便发生另一个动作。我将如何检测 UISlider 何时停止,然后编写 if 语句来执行其他操作。
【问题讨论】:
标签: uiimageview xcode6 uislider
我有一个 UISlider,它通过设置 CGRect 中的 x 值使 UIImageView 左右移动,使 UISlider.value。我想检测滑块何时停止,以便发生另一个动作。我将如何检测 UISlider 何时停止,然后编写 if 语句来执行其他操作。
【问题讨论】:
标签: uiimageview xcode6 uislider
我发现我需要做的就是添加
[zoomSlider addTarget:self action:@selector(stopSlider)
forControlEvents:UIControlEventTouchUpInside];
在 IBACTION 中为我的滑块添加,然后添加
-(void) stopSlider;{
with whatever code I wanted to happen when I stop touching the slider here
}
【讨论】: