我想让我的 UISlider 可点击 - 将点击时的值更改为“空白”,例如它设置为零,我单击 slider 的中间,它会“跳”到中间。有没有办法做到这一点?
我想提出类似于 jrtc27 的东西,但没有子类化:添加 UI(Tap)GestureRecognizer
到 slider 。
UISlider *slider = [[[UISlider alloc] init] autorelease];
//configure slider
UITapGestureRecognizer *tapGestureRecognizer = [[[UITapGestureRecognizer alloc] initWithTarget:self actionselector(sliderTapped] autorelease];
[slider addGestureRecognizer:tapGestureRecognizer];
- (void)sliderTappedUIGestureRecognizer *)gestureRecognizer {
UISlider *slider = (UISlider *) gestureRecognizer.view;
//setValue
}
关于objective-c - 可点击的 UISlider,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10249510/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |