title: Xamarin iOS subview created inside custom UIView class not showing up
body: <p>I have a custom UIView class, where I would like to add a bunch of subviews. This should be a simple task but I can't seem to figure out why my views are not showing up on the UI.</p>
  
  <p>The examples and tutorials out there are pretty straight forward and I believe I have implemented my code correctly. I have added a breakpoint at <code>AddSubview</code> and the container has a size.</p>
  
  <p>The UIViewController class already has a background image added it via the storyboard.</p>
  
  <p>Can someone help me see what I'm probably missing? I know it's something small.</p>
  
  <p>Below is my code:</p>
  
  <p><strong>The custom view class</strong></p>
  
  <pre><code>public class RotaryWheel : UIView
  {
      int numberOfSections;
  
    public RotaryWheel(CGRect frame,int sections): base(frame)
      {
         numberOfSections = sections;
  
         DrawWheel();
  
      }
  
    public void DrawWheel()
     {
         // derive the center x and y
            float centerX = (float)(Frame.Width / 2);
            float centerY = (float)(Frame.Height / 2);
  
          container = new UIView();
          container.Frame = new RectangleF(centerX, centerY, 100, 100);
          container.BackgroundColor = UIColor.White;
          AddSubview(container);
     }
  }
  </code></pre>
  
  <p><strong>The UIViewController</strong> class where I initialize the view</p>
  
  <pre><code>  public partial class HomePageController : UIViewController
    {
        public override void LoadView()
        {
          base.LoadView();
  
           rotaryWheel = new RotaryWheel(new CGRect(20f, (float)(View.Frame.Height / 2), (float)View.Frame.Size.Width, (float)View.Frame.Height / 2f), 7);
           View.AddSubview(rotaryWheel);
  
        }
  
    }
  </code></pre>