title: How to use Core Graphics in a UIViewController's Subview in Xamarin iOS?
body: <p>I have set up the following structure in my storyboard. I have a UIViewController that contains a UIView which contains buttons, text, and a smaller UIView. I would like to draw to the smaller UIView.</p>
  
  <p>The current working code I have is:</p>
  
  <pre><code>public partial class MyDrawingController : UIViewController
  {
      public MyDrawingController (IntPtr handle) : base(handle) { }
  
      public override void LoadView ()
      {
          base.LoadView ();
          View = new NewDrawingView ();
      }
  }
  
  public class NewDrawingView : UIView
  {
      public NewDrawingView () : base() {}
  
      public override void Draw (CGRect rect)
      {
          base.Draw (rect);
          DrawMe (rect);
      }
  
      public void DrawMe(CGRect rect) {
          // Drawing code
      }
  }
  </code></pre>
  
  <p>This results in the larger UIView's content being entirely replaced by my drawing (covering my text and buttons).</p>
  
  <pre><code>    NewDrawingView = new NewDrawingView();
  </code></pre>
  
  <p>While this calls the constructor, the UIView's Draw method is never called, thereby never giving be correct access to the UIGraphics context to do drawing.</p>
  
  <p><strong>Edit:</strong></p>
  
  <pre><code>    View.AddSubview(new NewDrawingView());
  </code></pre>
  
  <p>Also calls the constructor and not the Draw method (and doesn't appear to display a new view). How can I call the draw method of subview or otherwise draw within a subview?</p>