zoukankan      html  css  js  c++  java
  • iPhone中判断是否点击在某个圆形内

    1. - (BOOL) pointInside:(CGPoint)point withEvent:(UIEvent *)event   
    2. {  
    3. CGPoint pt;  
    4. float HALFSIDE = SIDELENGTH / 2.0f;  
    5. // normalize with centered origin  
    6. pt.x = (point.x - HALFSIDE) / HALFSIDE;  
    7. pt.y = (point.y - HALFSIDE) / HALFSIDE;  
    8. // x^2 + y^2 = radius  
    9. float xsquared = pt.x * pt.x;  
    10. float ysquared = pt.y * pt.y;  
    11. // If the radius < 1, the point is within the clipped circle  
    12. if ((xsquared + ysquared) < 1.0return YES;  
    13. return NO;  
    14. }  

    id 博主 = [[KILONET.CNBLOGS.COM alloc] initWithValue:@"天堂向右,我依然向左"

                  网名:@"老舟"

                  兴趣:@"影音,阅读"

                  动态:@"系统架构设计,Android通信模块开发"

                  网址:@"http://kilonet.cnblogs.com"
                  签名:@"--------------------------------------------------

                                  Stay Hungry , Stay Foolish

                                  求  知  若  渴,处  事  若  愚

                              --------------------------------------------------"

                  ];         // Never Release

  • 相关阅读:
    RocketMq(三、重试机制)
    RocketMq(二、生产者、消费者demo)
    VUE(四、ajax-axios)
    配置git DiffMerge工具
    Gerrit 删除项目
    html元素
    UML类图细节
    json 转 javaBean
    将文件的编码格式转换为utf-8
    第四篇:Eclipse Android app 工程迁移到 Android Studio
  • 原文地址:https://www.cnblogs.com/KiloNet/p/1807320.html
Copyright © 2011-2022 走看看