首页 > 其他 > 详细

给button添加长按手势并侦测到此button

时间:2014-06-30 21:13:44      阅读:459      评论:0      收藏:0      [点我收藏+]


1, 添加手势

 

 self.longPressRecognizer = [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(handleLongPress:)];
[btn addGestureRecognizer:self.longPressRecognizer];

 

2,得到当前执行长点选的button

- (void)handleLongPress:(UILongPressGestureRecognizer *)recognizer

    UIButton *btn = (UIButton *)recognizer.view;

给button添加长按手势并侦测到此button,布布扣,bubuko.com

给button添加长按手势并侦测到此button

原文:http://www.cnblogs.com/lisa090818/p/3816167.html

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