Building custom components for Xamarin Studio's new iOS designer
I wrote a detailed, hands-on introduction to using the new iOS designer in Xamarin Studio. The blog post explains how to build custom user interface components that will be live-rendered on the design surface:
[Register("RectSample")]
public class RectSample : UIView
{
public RectSample () {}
public RectSample (IntPtr handle) : base (handle) {}
[Export, Browsable(true)]
public int Red { get; set; }
[Export, Browsable(true)]
public int Green { get; set; }
[Export, Browsable(true)]
public int Blue { get; set; }
public override void Draw (RectangleF rect)
{
var path = UIBezierPath.FromRoundedRect(rect.Inset(1, 1), 4);
UIColor.FromRGB (Red, Green, Blue).SetFill ();
path.Fill();
UIColor.Black.SetStroke();
path.Stroke();
}
}
Written by Ryan Paul
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ios
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#