现在的位置: 首页 > 综合 > 正文

启用长按事件 UILongPressGestureRecognizer

2013年09月18日 ⁄ 综合 ⁄ 共 448字 ⁄ 字号 评论关闭

UILongPressGestureRecognizer *longPressGR = 

        [[UILongPressGestureRecognizer alloc] initWithTarget:self 

                                                      action:@selector(handleLongPress:)];

        longPressGR.minimumPressDuration = 0.2;

        [self addGestureRecognizer:longPressGR];

        [longPressGR release];



- (void)handleLongPress:(UIGestureRecognizer *)gestureRecognizer {

    NSLog(@"LONG PRESS");

}

 

UILongPressGestureRecognizer  正解,要求ios3.2以上

抱歉!评论已关闭.