首页 > 移动平台 > 详细

ios手势识别之长按

时间:2016-01-23 22:59:22      阅读:215      评论:0      收藏:0      [点我收藏+]
 1     // 1.创建手势识别器
 2     UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] init];
 3     // 1.1设置长按手势识别器的属性
 4     //    longPress.minimumPressDuration = 5;
 5     
 6     // 手指按下后事件响应之前允许手指移动的偏移位
 7     longPress.allowableMovement = 50;
 8     
 9     
10     // 2.添加手势识别器到View
11     [self.customView addGestureRecognizer:longPress];
12     
13     // 3.监听手势识别器
14     [longPress addTarget:self action:@selector(longPressView)];
15 }
16 
17  -(void)longPressView
18 {
19     NSLog(@"长按事件");
20 }

 

ios手势识别之长按

原文:http://www.cnblogs.com/PJHome/p/5154172.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!