Skip to content

Instantly share code, notes, and snippets.

@Redth
Created September 26, 2013 15:37
Show Gist options
  • Select an option

  • Save Redth/6715940 to your computer and use it in GitHub Desktop.

Select an option

Save Redth/6715940 to your computer and use it in GitHub Desktop.
The Length property is currently missing from the Xamarin.iOS API for IUILayoutSupport (TopLayoutGuide, BottomLayoutGuide). Here's a quick hack to fix it temporarily...
using MonoTouch.UIKit;
using MonoTouch.ObjCRuntime;
namespace Shield
{
public static class TopLayoutGuideExtensions
{
public static float Length(this IUILayoutSupport layoutSupport)
{
float length = 0f;// = 0;
try
{
var selector = new Selector ("length");
length = MonoTouch.ObjCRuntime.Messaging.float_objc_msgSend (layoutSupport.Handle, selector.Handle);
}
catch { }
return length;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment