美文网首页
UIGestureRecognizer基本使用

UIGestureRecognizer基本使用

作者: 蘇哲炫爺 | 来源:发表于2015-12-31 14:19 被阅读49次

UIGestureRecognizer基类是一个抽象类,一般主要使用它的子类

•UITapGestureRecognizer

•UIPinchGestureRecognizer

•UIRotationGestureRecognizer

•UISwipeGestureRecognizer

•UIPanGestureRecognizer

•UILongPressGestureRecognizer

从名字上我们就能知道,Tap(点击)、Pinch(捏合)、Rotation(旋转)、Swipe(滑动,快速移动,是用于监测滑动的方向的)、Pan (拖移,慢速移动,是用于监测偏移的量的)以及 LongPress(长按)。

举个例子 ,看看给UILabel来添加一个点击事件

执行效果:

其余的都一样我在这里就不用一一列举啦!

相关文章

网友评论

      本文标题:UIGestureRecognizer基本使用

      本文链接:https://www.haomeiwen.com/subject/hdobhttx.html