zoukankan      html  css  js  c++  java
  • ios判断点击的坐标点

     

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

    {

        NSSet *allTouches = [event allTouches];    //返回与当前接收者有关的所有的触摸对象

        UITouch *touch = [allTouches anyObject];   //视图中的所有对象

        CGPoint point = [touch locationInView:[touch view]]; //返回触摸点在视图中的当前坐标

        int x = point.x;

        int y = point.y;

        

        if(y<self.frame.size.height - 500)

        {

            [self removeFromSuperview];

        }

    }

  • 相关阅读:
    2017.8.07
    2017.8.05
    2017.8.04
    2017.8.03
    2017.8.02
    2017.8.01
    2017.7.31
    2017.7.29
    2017.7.28
    简易日历
  • 原文地址:https://www.cnblogs.com/xiangjune/p/5016145.html
Copyright © 2011-2022 走看看