【发布时间】:2012-05-11 15:53:04
【问题描述】:
floorf(CGRectGetMinX(visibleBounds) / CGRectGetWidth(visibleBounds));
CGrectGetWidth 和 CGrectGetMinX 方法的单点触控版本是什么?
【问题讨论】:
标签: xamarin.ios cgrect
floorf(CGRectGetMinX(visibleBounds) / CGRectGetWidth(visibleBounds));
CGrectGetWidth 和 CGrectGetMinX 方法的单点触控版本是什么?
【问题讨论】:
标签: xamarin.ios cgrect
Xamarin.iOS 引入了 Unified API,它现在包含 CGRect 和 CoreGraphics 命名空间中的朋友。
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;
希望有帮助
亚历克斯
【讨论】: