任何控件的 iPhone 触摸事件
我正在使用 core-plot 库来做一些绘图,并且想在图表上实现一些触摸控制。问题是,核心图图表视图似乎不响应触摸。我读过很多地方,可以将不可见的控件放置在另一个控件上,并使用该控件来提供底层控件触摸事件。问题是,我不知道如何实现它。似乎什么都不起作用。是否有某种方法可以专门为控件分配您自己的触摸事件,并与其他控件分开处理它们?一些显示如何正确设置的源代码会很棒。
I'm using the core-plot library to do some plotting, and would like to implement some touch control on the graph. Problem is, the core-plot graph view doesn't seem to respond to touches. I've read many places that it's possible to place an invisible control over another control and use that control to give the underlying control touch events. Problem is, I can't figure out how to implement it. Nothing seems to be working. Is there some way to specifically assign a control your own touch events and to handle them separately from the other controls? Some source code showing how this should be set up properly would be awesome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只是在我睡觉前问一个简单的问题(在欧洲已经过了午夜:))。您是否尝试使用backgroundColor = [UIColorclearColor]将子视图添加到图形中并附加UIGestureRecognizer?
Just a simple question before I go to sleep (it is past midnight in Europe :)). Did you try adding subview to your graph with backgroundColor = [UIColor clearColor] and attaching a UIGestureRecognizer to it?