zoukankan      html  css  js  c++  java
  • ios 单击和双击

    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {

        //--------------------单击、双击----------------------

        UITouch *touch = [touches anyObject];

        NSUInteger tapCount = touch.tapCount;

        if (tapCount == 1) {

            [selfperformSelector:@selector(singleTap) withObject:nilafterDelay:0.2];//0.2或者0.3 根据自己的感官调整

        }

        else if(tapCount == 2) {

            

            [NSObjectcancelPreviousPerformRequestsWithTarget:selfselector:@selector(singleTap) object:nil];

            

            [self doubleTap];

        }

    }

     加粗的方法就是双击和双击你要实现的功能的方法

  • 相关阅读:
    软件工程概论
    软件工程概论
    JAVA
    JAVA
    C#字符补位
    C#绘图双缓冲
    C#中IP地址转换为数值的方法
    C#并行编程-并发集合
    C#委托
    C#事件(event)解析
  • 原文地址:https://www.cnblogs.com/mohe/p/3084180.html
Copyright © 2011-2022 走看看