简体   繁体   English

辅助功能:在Voice-over模式下设置slider.value时,不会发布UISlider的UIControlEventValueChanged

[英]Accessibility: UISlider's UIControlEventValueChanged is not posted when slider.value is set in Voice-over mode

I am having a UISlider in my parent view. 我在父视图中有一个UISlider。 I want to honor the Voice-over gestures for slider movement and thus, i have implemented accessibilityIncrement and accessibilityDecrement methods as below: 我想尊重滑块移动的配音手势,因此,我已经实现了accessibilityIncrement和accessibilityDecrement方法,如下所示:

- (void)accessibilityIncrement
{
     float finalValue = self.value;
    finalValue = (finalValue + 1);
    if (finalValue > self.maximumValue)
        finalValue = self.maximumValue;
    self.value = finalValue;    
}

- (void)accessibilityDecrement
{
    float finalValue = self.value;
    finalValue = (finalValue - 1);
    if (finalValue < self.minimumValue)
        finalValue = self.minimumValue;
    self.value = finalValue;

}

The issue is when I set the value of the slider (using self.value = finalValue), the selector for UIControlEventValueChanged event does not get called. 问题是当我设置滑块的值(使用self.value = finalValue)时,不会调用UIControlEventValueChanged事件的选择器。 Is this a Bug? 这是一个Bug吗?

Thanks! 谢谢!

对于带有VoiceOver的UISlider推荐的解决方案包括在代码中使用委托 ,使用已经使用的incrementdecrement方法根据旋钮位置调整滑块值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM