• <UI>TableViewCELL长按事件


    //长按事件的手势监听实现方法
    - (void) myHandleTableviewCellLongPressed:(UILongPressGestureRecognizer *)gestureRecognizer {
        if (gestureRecognizer.state == UIGestureRecognizerStateBegan) {
            NSLog(@"UIGestureRecognizerStateBegan");
        }
       if (gestureRecognizer.state == UIGestureRecognizerStateChanged) {
            NSLog(@"UIGestureRecognizerStateChanged");
        }
    
       if (gestureRecognizer.state == UIGestureRecognizerStateEnded) {
            NSLog(@"UIGestureRecognizerStateEnded");
        }
    }
    - (void)viewDidLoad
    {
    
        //------------------------------------------------------------------------------------
        //创建长按手势监听 
        UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] 
                   initWithTarget:self 
                   action:@selector(myHandleTableviewCellLongPressed:)];
        
        //代理
        longPress.delegate = self;
        longPress.minimumPressDuration = 1.0;
        //将长按手势添加到需要实现长按操作的视图里
        [myTableViewControl addGestureRecognizer:longPress];
    
    
        [longPress release];
        //------------------------------------------------------------------------------------
    
        [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
    }
  • 相关阅读:
    Python课程回顾(day26)网络编程
    Python课程回顾(day27)
    Python课程回顾(day25)
    Python课程回顾(day24)
    Python课程回顾(day23)
    Python课程回顾(day22)
    Python课程回顾(day21)
    Python课程回顾(day20)
    Python课程回顾(day19)
    hive小tips(各种解析)
  • 原文地址:https://www.cnblogs.com/robinkey/p/2798332.html
Copyright © 2020-2023  润新知