iPhone上划动事件--UISwipeGestureRecognizer

如果想完成在UIView上的划动,比如左划一下向前,上划一下某动作,怎么实现呢。 其实很简单的,用UISwipeGestureRecognizer就可以了。  UISwipeGestureRecognizer* swipe = [[UISwipeGestureRecognizer alloc]                                            initWithTarget:self action:@selector(swipe:)];         swipe.direction = UISwipeGestureRecognizerDirectionRight | UISwipeGestureRecognizerDirectionLeft;         [self addGestureRecognizer:swipe];         [swipe release]; 这就是在一个UIView上指定了左右划动的事件了。  

posted on 2013-04-18 09:48  流れ星ーー  阅读(178)  评论(0编辑  收藏  举报

导航