如何啓用長按事件

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");
}
發佈了82 篇原創文章 · 獲贊 6 · 訪問量 15萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章