【问题标题】:CgRectGetWidth monotouchCgRectGetWidth 单点触控
【发布时间】:2012-05-11 15:53:04
【问题描述】:
floorf(CGRectGetMinX(visibleBounds) / CGRectGetWidth(visibleBounds)); 

CGrectGetWidth 和 CGrectGetMinX 方法的单点触控版本是什么?

【问题讨论】:

    标签: xamarin.ios cgrect


    【解决方案1】:

    更新 Xamarin.iOS 统一 API

    Xamarin.iOS 引入了 Unified API,它现在包含 CGRectCoreGraphics 命名空间中的朋友。


    CGRect 映射到 System.Drawing.RectangleF (See Type Mappings)

    如果你有自己的System.Drawing.RectangleF

    代码看起来像

    RectangleF visibleBounds = new RectangleF(0, 0, 10, 10); // Or your own instance of visibleBounds           
    float minx = visibleBounds.GetMinX();
    float w = visibleBounds.Width;
    

    希望有帮助

    亚历克斯

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-09-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多