input拖动时突出显示button

刚开始探索iOS SDK。 我有一些button,需要突出显示他们触摸外面一次,然后拖动。 据我所知,TouchDragEnter事件触发,当你点击button,然后拖到外面再次拖动里面。 点击button外部时,是否有任何事件触发,然后拖入内部?

亚历山大,

search相同的信息,我看到你的问题没有得到回答。 你可能已经知道了,但这是我如何做到的。

请注意,pointInside:withEvent:方法检查点是否位于button的边界内。 由于触摸事件来自视图,您必须将其转换为button的坐标系。

-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { for (UITouch *t in touches) { CGPoint touchPoint = [t locationInView:self.view]; CGPoint testPoint = [self.view convertPoint:touchPoint toView:aButton]; if ([aButton pointInside:testPoint withEvent:event]) { //Do something } //rest of code