0

私はUISliderUICollectionViewのスクロール方向horizontalを持っています。`UISlider`の値を変更したいとき、scrollViewはスライダの代わりに左にスクロールします

私はUISliderで値を変更したい場合は、scrollViewのスクロールは、スライダーの代わりに左に!

私はスライダーにUITapGestureRecognizer/UISwipeGestureRecognizerを追加しようとしました。

それは助けにはなりませんでした。

+2

はあなたのいくつかのコードを追加します。 –

+0

よくある問題です。これらの答えを見て、それらを試してみてください。http://stackoverflow.com/questions/5222998/uigesturerecognizer-blocks-subview-for-handling-touch-events – brigadir

+0

おかげで、しかし、それは私が探していたまさにではありません –

答えて

0

今すぐ動作します!私が追加:

override func hitTest(point: CGPoint, withEvent event: UIEvent?) -> UIView? { 

    if !self.userInteractionEnabled || self.hidden || self.alpha <= 0.01 { 
     return nil 
    } 

    for subview:UIView in self.subviews{ 
     let convertedPoint:CGPoint = subview.convertPoint(point, fromView: self) 
     if let hitTestView: UIView = subview.hitTest(convertedPoint, withEvent: event) { 
      if viewRating.frame.contains(point){ 
       delegate!.stopScrollCollectionView(true) 
      }else{ 
       delegate!.stopScrollCollectionView(false) 
      } 
      return hitTestView 
     } 
    } 
    return self 
} 
関連する問題