0
我似乎无法能够找出为什么这个代码转发的UIButton触摸停在iOS5的工作:的UIButton触摸转发不工作在iOS5中(仅在iPad上)
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesBegan:touches withEvent:event];
[self.nextResponder touchesBegan:touches withEvent:event];
}
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesMoved:touches withEvent:event];
[self.nextResponder touchesMoved:touches withEvent:event];
}
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
[super touchesEnded:touches withEvent:event];
[self.nextResponder touchesEnded:touches withEvent:event];
}
当我登录了下一个响应者的触摸方法,我可以看到,触动移动只转发一次,触摸结束是根本不转发。这是非常意想不到的行为,因为所有触动都在iOS4中转发。任何帮助,将不胜感激。
上面的代码在你的UIButton子类中? – 2012-08-15 21:31:01
是的,它在我创建的UIButton子类中。 – daveMac 2012-08-15 21:54:02
那么,它在模拟器中工作吗?我只是做了一个子类测试,它的所有工作都很完美。 – 2012-08-15 21:57:56