0

当你在 UIImageView 上滑动手指时如何检测?例如,假设您将手指滑过它,它会改变颜色或其他东西。我希望能够滑过多个 UIImageViews 并发生一些事情......

4

1 回答 1

0

试一试!UIImageView_UIScrollView

要检测您在 a 中的触摸,UIImageView您必须重写 aUIImageView并设置UserInteractionEnabledYES。然后你可以处理像touchesBegan和这样的事件touchesEnded

UIImageWithTouchControl.h

@interface UIImageWithTouchControl : UIImageView

UIImageWithTouchControl.m

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
}

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
}
于 2010-05-05T13:57:45.397 回答