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

  • 相关阅读:
    rsync
    SAMBA服务搭建
    top,job,user,file,alias
    FTP服务搭建
    shell_script2
    shell_script1
    shell_processing
    shell_advanced
    shell_basic
    docker搭建私有仓库遇到的坑 http: server gave HTTP response to HTTPS client
  • 原文地址:https://www.cnblogs.com/xiamo123/p/4763327.html
Copyright © 2011-2022 走看看