zoukankan      html  css  js  c++  java
  • 触摸事件

    //*****添加手势,一定要打开用户交互,否则就不会响应

        imgv.userInteractionEnabled=YES;

        //创建一个点击手势

        UITapGestureRecognizer *tap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapChangeAction:)];

        //把创建的单击手势给图片视图

        [imgv addGestureRecognizer:tap];

       

        //创建一个旋转的手势对象

        UIRotationGestureRecognizer*rotation=[[UIRotationGestureRecognizer alloc]initWithTarget:self action:@selector(rotationChangeAction:)];

        //添加手势到imgv

        [imgv addGestureRecognizer:rotation];

        //创建捏合手势

        UIPinchGestureRecognizer *pinch=[[UIPinchGestureRecognizer alloc]initWithTarget:self action:@selector(pinchChangeAction:)];

        //添加手势

        [imgv addGestureRecognizer:pinch];

        //创建长按手势

        UILongPressGestureRecognizer *longpress=[[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longPressAction:)];

        [imgv addGestureRecognizer:longpress];

       

        //创建扫动手势

        UISwipeGestureRecognizer *swipe=[[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeChangeAction:)];

        swipe.direction=UISwipeGestureRecognizerDirectionLeft;

        [imgv addGestureRecognizer:swipe];

  • 相关阅读:
    DDOS和cc攻击的防御
    shell脚本基础知识
    MySQL常用的查询命令
    shell常见脚本30例
    shell中的函数
    shell中的数字
    shell中的ps3为何物以及select循环
    FPGA设计经验谈 —— 10年FPGA开发经验的工程师肺腑之言
    FPAG结构 组成 工作原理 开发流程(转)
    modelsim仿真中 do文件的写法技巧
  • 原文地址:https://www.cnblogs.com/xiamo123/p/4763327.html
Copyright © 2011-2022 走看看