【发布时间】:2011-07-17 15:43:21
【问题描述】:
我在视图上创建了一个 UIButton,我想让 touchesMoved 只控制 UIButton,而不是整个视图
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{
UITouch *touch = [touches anyObject];
CGPoint touchMoved = [touch locationInView:self.view];
}
我想这样做 如果我触摸 UIButton,然后 UIButton 可以用我的手指移动,如果我触摸其他视图并且我的手指在屏幕上移动,则 UIButton 什么也不做。 这意味着函数 touchesMoved 只有 UIButton 的作用,那我该怎么做呢?谢谢
【问题讨论】:
标签: objective-c ios event-handling uibutton