I am trying to convert an open source flyout menu from Objective-C to Xamarin. The current issue I have is that the Obj-C code creates a frame using CGRectInfinite. This does not appear to be available under MonoTouch, via the usual RectangleF class. Is there an alternative?

Similarly, there does not appear to be a CGRectIsInfinite equivalent in RectangleF. What, if any, is the alternative?

有帮助吗?

解决方案

Add this using statement first:

using MonoTouch.CoreGraphics;

Then you can test it with this:

public static RectangleF GetInfinite()
{
    var image = CIImage.EmptyImage;

    if (image.Extent.IsInfinite ())
    {
        return image.Extent;
    }

    throw new Exception ("Unable to create infinite rect");
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top