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];

  • 相关阅读:
    Nexus centos 安装
    Linux下Redis的安装和部署
    Markdown编辑器
    mysql 递归查询 主要是对于层级关系的查询
    Maven 打包的时候报 Failed to execute goal org.codehaus.mojo:native2ascii-maven-plugin
    WPS 认证机制
    网络延迟分析
    帧传送、关联与身份验证状态
    802协议族
    【转】Hostapd工作流程分析
  • 原文地址:https://www.cnblogs.com/xiamo123/p/4763327.html
Copyright © 2011-2022 走看看