我有一个Viewcontroller
两个UIViews
,一个名为textureView
和一个objectView
。检测子视图上的触摸
当我只有一个观点我使用这个检测触摸:
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
NSArray *allTouches = [touches allObjects];
for (UITouch *touch in allTouches)
{
gestureStartPoint = [touch locationInView:self.view];
if([touch view] == controlUIImageview){
NSLog(@"TOUCH DETECT");
}
}
}
我怎样写这部分,如果我有一些事情我想在textureView
有的在objectView
与互动?
是否需要将textureView
和controlView
设置为setUserInteractionEnabled:TRUE
?
谢谢!
你有没有尝试设置textureView和对照olView to setUserInteractionEnabled:TRUE?当你尝试时发生了什么? –