2015-04-07 45 views
3

我在我的項目中使用EFCircular滑塊的實例。有6個滑塊,每個滑塊都有不同的最大值。一旦滑塊達到最大值,通常如果我們進一步滑動,它將回到最小值(0)。但是我想限制滑塊達到其最大值,即使我們進一步嘗試按順時針方向移動滑塊。當我們試圖在其值爲零(0)時逆時針方向移動滑塊時,也會出現相同的行爲。它不應該反向。EFCircularSlider - 如何避免滑塊,滑過最大值設置

任何指針或幫助將不勝感激。

+0

沒有ü找到答案 –

+0

我在尋找答案!?? – Bernard

回答

-1

只需更換這種方法

-(BOOL) continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event { 
    [super continueTrackingWithTouch:touch withEvent:event]; 

    CGPoint lastPoint = [touch locationInView:self]; 
    float _currentValueTemp = [self valueFromAngle]; 
    if(_currentValueTemp <= 0.8 || _currentValueTemp >= _maximumValue){ 

     return YES; 

    } 
    [self moveHandle:lastPoint]; 
    [self sendActionsForControlEvents:UIControlEventValueChanged]; 

    return YES; 
}