iOS按钮长按

时间:2014-08-07 18:40:20   收藏:0   阅读:316

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

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!