objective-c – 如何检测/处理弯曲区域的触摸事件?
我开始使用原生iPad应用程序(如果需要,我们可以假设iOS 4.3),我需要有一系列相互碰撞的弯曲区域.
我喜欢一些关于处理这个问题的最佳方法的建议. 我有一个想法是使用WebView,只有一个JPG和一个HTML图像映射,但我真的更喜欢使用某种支持曲线的原生UI元素. 有什么建议? 解决方法
我们有这样的问题.为了解决这个问题,我们在Adobe Illustrator中创建了一个黑白面具.您需要为所需的每个不同区域执行此操作.
接下来,我们导出了这个文件.我不记得文件导出选项,但基本上你得到一个文本文件,其中包含一些路径数据,包括行,贝塞尔曲线等. 然后我们接受了这个文件并写了一个解析它的导入器并创建了一个CGPath. 最后阶段很简单.您可以从UITouch获取触摸点并执行CGPathContainsPoint调用. 这是一些伪代码: >在我们使用“1 XR”之前跳过线.那就是 (a)组件数包括行动,因此我们需要减少这一点.例如. 274.5600 463.6800米 cp1x = previous line's components object at index 0 cp1y = previous line's components object at index 1 cp2x = this line's components object at index 0 cp2y = this line's components object at index 1 x = this line's components object at index 2 y = this line's components object at index 3 (c)否则,如果该线有四个坐标,前一行有四个或六个坐标,则如下图所示: cp1x = this line's components object at index 0 cp1y = this line's components object at index 1 cp2x = this line's components object at index 2 cp2y = this line's components object at index 3 x = this line's components object at index 2 y = this line's components object at index 3 其中cp是“控制点”.所以你有控制点1和控制点2及其各自的x和y坐标. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |