我在UISlider
滚动方向UICollectionView
中horizontal
。
当我想更改UISlider
中的值时,scrollView会向左滚动而不是滑块!!
我尝试将UITapGestureRecognizer/UISwipeGestureRecognizer
添加到滑块。
没有用。
答案 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
}