ios - 在子视图内拖动时禁用 UIScrollView 滚动 - Swift
问题描述
为了在我的应用程序中实现图表,我使用了这个库:https ://github.com/AAChartModel/AAChartKit-Swift
我的图表视图位于 UIScrollView 内。当用户在图表视图中拖动值时,我希望我的 UIScrollView 不会同时滚动。
我尝试通过覆盖这些方法来实现这一点:
open override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)
guard let touchPoint = touches.first?.location(in: self) else { return }
}
open override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesEnded(touches, with: event)
}
但即使我在 AAChartView 扩展中覆盖这些方法,触摸也只能在图表周围识别。
解决方案
推荐阅读
- deep-learning - 微调迁移学习中的模型
- git - 如何使用 git filter-repo 作为带有 Python 模块接口的库?
- apache-spark - 聚合盐以对抗倾斜
- java - 带有欧元符号问题的 Maven/Nexus 密码
- c++ - CMake 链接 Qt5::Svg 但 QImageReader 看不到
- javascript - JavaScript 先加载特定图像 (gif)
- android - 在 Dao 中使用 @Query 时的 Room [exception:KaptExecution]
- sql - 有没有办法组合一系列可能没有共同列的表
- javascript - 如何使用 Google App Scripts 使数据透视表的列范围动态化?
- microsoft-teams - 如何获取使用 MS Graph API 创建的所有会议参与者的列表,