Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Description of Issue: There really is no way to use UIEdgeInsetsInsetRect (because it isn't available), and there isn't a tidy way to workaround.
There's generally a 2 line workaround for missing p/invokes, in this case:
public extern static RectangleF UIEdgeInsetsInsetRect (RectangleF rect, UIEdgeInsets inset);
I'll add it to the UIEdgeInsets struct for newer releases, once I do/add some tests and check if other similar API could be missing.
Anyway keep in mind this does not need to be a blocker for customers.
That above won't work since it's not a function but a macro. OTOH the macro  can easily be translated to C#:
public RectangleF InsetRect (RectangleF rect, UIEdgeInsets insets)
return new RectangleF (rect.X + insets.Left,
rect.Y + insets.Top,
rect.Width - insets.Left - insets.Right,
rect.Height - insets.Top - insets.Bottom);
 found in /Applications/Xcode.app//Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIGeometry.h
Fixed in master-3.0 877af7b0af395e84639a4765c8d7863357999c43
QA: Unit tests added in the same revision
Why UIEdgeInsets.InsetRect takes only 1 parameter? or I am using the wrong method? I am trying to migrate a class from Objective C to C# and it uses UIEdgeInsetsInsetRect which takes two arguments while the RectInset I see in monotouch is tacking 1 argument. Thanks.
Fernando, it's because UIEdgeInsets.InsetRect is an instance method, so it does in fact that two parameters ('this' and the one you pass).
For example this in Objective-C:
inset = UIEdgeInsetsInsetRect (edge_inset, rect);
would become this in C#:
inset = edge_inset.InsetRect (rect);