gpt4 book ai didi

ios - 当我想更改 `UISlider` 中的值时,scrollView 向左滚动而不是 slider

转载 作者:行者123 更新时间:2023-11-30 13:20:31 28 4
gpt4 key购买 nike

我在UICollectionView滚动方向水平中有UISlider

当我想更改UISlider中的值时,scrollView向左滚动而不是 slider !!

我尝试将 UITapGestureRecognizer/UISwipeGestureRecognizer 添加到 slider 。

这没有帮助。

最佳答案

现在可以了!我补充道:

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
}

关于ios - 当我想更改 `UISlider` 中的值时,scrollView 向左滚动而不是 slider ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37810767/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com