0
我有UISlider
在UICollectionView
滾動方向horizontal
。當我想改變`UISlider`中的值時,scrollView向左滾動而不是滑動條
當我想要更改UISlider
中的值時,scrollView向左滾動而不是滑動!
我試着將UITapGestureRecognizer/UISwipeGestureRecognizer
添加到滑塊。
它沒有幫助。
我有UISlider
在UICollectionView
滾動方向horizontal
。當我想改變`UISlider`中的值時,scrollView向左滾動而不是滑動條
當我想要更改UISlider
中的值時,scrollView向左滾動而不是滑動!
我試着將UITapGestureRecognizer/UISwipeGestureRecognizer
添加到滑塊。
它沒有幫助。
現在,它的工作原理!我補充說:
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
}
添加你的一些代碼。 –
這是常見問題。看看這些答案,並嘗試它們:http://stackoverflow.com/questions/5222998/uigesturerecognizer-blocks-subview-for-handling-touch-events – brigadir
謝謝,但它不是我正在尋找 –