【问题标题】:detecting when a UISlider finishes Xcode检测 UISlider 何时完成 Xcode
【发布时间】:2014-11-14 15:18:36
【问题描述】:

我有一个 UISlider,它通过设置 CGRect 中的 x 值使 UIImageView 左右移动,使 UISlider.value。我想检测滑块何时停止,以便发生另一个动作。我将如何检测 UISlider 何时停止,然后编写 if 语句来执行其他操作。

【问题讨论】:

标签: uiimageview xcode6 uislider


【解决方案1】:

我发现我需要做的就是添加

[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
}

【讨论】:

    猜你喜欢
    • 2019-07-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多