码迷,mamicode.com
首页 > 移动开发 > 详细

iOS按钮长按

时间:2014-08-07 18:40:20      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:os   io   ar   cti   res   ios   ad   ui   

UILongPressGestureRecognizer *longPressGR = 

                [[UILongPressGestureRecognizer alloc] initWithTarget:self 

                                                              action:@selector(handleLongPress:)];

                longPressGR.allowableMovement=NO;

                longPressGR.minimumPressDuration = 0.2;

                [btn addGestureRecognizer:longPressGR];

                [longPressGR release];

 //响应的事件

-(IBAction)handleLongPress:(id)sender{

    

        UIButton *button=(UIButton*)[(UILongPressGestureRecognizer *)sender view];

        NSInteger ttag=[button tag];

 

}

iOS按钮长按,布布扣,bubuko.com

iOS按钮长按

标签:os   io   ar   cti   res   ios   ad   ui   

原文地址:http://www.cnblogs.com/XCoderLiu/p/3897640.html

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