【发布时间】:2010-03-27 04:44:20
【问题描述】:
如何检测手指滑过 UIImageView 的时间?例如,假设您将手指滑过它,它会改变颜色或其他东西。我希望能够滑过多个 UIImageViews 并发生一些事情......
【问题讨论】:
标签: iphone sdk uiimageview touch swipe
如何检测手指滑过 UIImageView 的时间?例如,假设您将手指滑过它,它会改变颜色或其他东西。我希望能够滑过多个 UIImageViews 并发生一些事情......
【问题讨论】:
标签: iphone sdk uiimageview touch swipe
在UIScrollView 中尝试UIImageView!
要在UIImageView 中检测您的触摸,您必须重写UIImageView 并将UserInteractionEnabled 设置为YES。然后你可以处理像touchesBegan和touchesEnded这样的事件。
UIImageWithTouchControl.h
@interface UIImageWithTouchControl : UIImageView
UIImageWithTouchControl.m
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
}
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
}
【讨论】: