如何识别特定视图中的触摸 [英] how identify touch in a particular view
本文介绍了如何识别特定视图中的触摸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何触摸特定视图.
我正在使用
CGPoint Location = [[touches anyObject] locationInView:self.view ];
,但只希望在单击特定的子视图后才触发操作.
怎么做.
but want to trigger the action only if an particular subView is clicked.
How to do this.
推荐答案
我自己得到了答案...但感谢其他人对此给予了帮助
I got the answer myself...but thanks other which helped me on this
在这里
UITouch *touch ;
touch = [[event allTouches] anyObject];
if ([touch view] == necessarySubView)
{
//Do what ever you want
}
这篇关于如何识别特定视图中的触摸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文