开发者

Sliding finger UIImageView

How do you detect when you slide your finger across a UIImageView? Say for example you slide your finger across it and it changes color or something. I want to be able to slide across multiple UIImageViews and have somet开发者_JS百科hing happen...


Try a UIImageView within a UIScrollView!

To detect your touchs in a UIImageView you have to rewrite a UIImageView and set UserInteractionEnabled to YES. Then you can handle events like touchesBegan and touchesEnded.

UIImageWithTouchControl.h

@interface UIImageWithTouchControl : UIImageView

UIImageWithTouchControl.m

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

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜