码迷,mamicode.com
首页 > 其他好文 > 详细

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

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

标签:style   color   cti   io   res   ui   


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

标签:style   color   cti   io   res   ui   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!