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

  • 相关阅读:
    Lighting maps_练习二
    Lighting maps_练习一
    Materials_练习
    Basic Lighting_练习二
    *201809-3
    程序设计思维与实践 Week14 作业 (3/4/数据班)
    程序设计思维与实践 Week14 限时大模拟 (3/4/数据班)
    程序设计思维与实践 Week15 作业 (3/4/数据班)
    程序设计思维与实践CSP-M4补题
    CCF201609-3
  • 原文地址:https://www.cnblogs.com/xiamo123/p/4763327.html
Copyright © 2011-2022 走看看