【发布时间】:2010-05-12 15:44:55
【问题描述】:
我已将 UISlider 设置为响应值更改事件:
[customSlider addTarget:self action:@selector(sliderMove:) forControlEvents:UIControlEventValueChanged];
[customSlider addTarget:self action:@selector(sliderStart:) forControlEvents:UIControlEventTouchDown];
[customSlider addTarget:self action:@selector(sliderEnd:) forControlEvents:UIControlEventTouchUpInside];
我想将滑块动画到用户上次使用视图时离开的位置。我这样做:
[customSlider setValue:position animated:YES];
一切正常,除了,我建立了一个“标签”,它挂在滑块“旋钮”上,这样用户在移动滑块时可以看到值。在 UIControlEventValueChanged 调用“sliderMove”方法时设置“标签”的位置。
使用[slider setValue:position animated:YES] 时,滑块会移动,但事件不会触发。
是否有我可以联系到的代表或涵盖这种情况的活动?
感谢您提供的任何帮助:)
【问题讨论】:
标签: iphone cocoa-touch uislider