title: Text jumps in UITextField when focused
body: <p>I'm dealing with this weird problem...the text inside the UITextField jumps when its focused.</p>
  
  <p><a href="https://www.youtube.com/watch?v=6AkgWXkmBwE" rel="nofollow">https://www.youtube.com/watch?v=6AkgWXkmBwE</a></p>
  
  <p>It's a custom UIView that I have created and is used inside another UIViewController.
  I've tried removed Draw function, didn't work. Removed all the styling and fonts...no change.</p>
  
  <p>Any idea what's wrong?</p>
  
  <pre><code>using System;
  using UIKit;
  using Foundation;
  using System.Drawing;
  using CoreGraphics;
  
  namespace whatever
  {
      [Register("LoginPanelView")]
      public class LoginPanelView : UIView
      {
  
          public UITextField UserNameField { get; private set; }
  
          public UITextField PasswordField { get; private set; }
  
          private const float HorizontalMargin = 15;
  
          public LoginPanelView(IntPtr handle)
              : base(handle)
          {
  
              UserNameField = new UITextField();
              PasswordField = new UITextField();
  
              UserNameField.Placeholder = "Username";
              PasswordField.Placeholder = "Password";
  
              UserNameField.Font = UIFont.FromName("Avenir", 14);
              PasswordField.Font = UIFont.FromName("Avenir", 14);
              PasswordField.SecureTextEntry = true;
  
              AddSubviews(new [] { UserNameField, PasswordField });
  
              Layer.CornerRadius = 5.0f;
              Layer.BorderColor = UIColor.Gray.CGColor;
              ClipsToBounds = true;
  
          }
  
          public override void LayoutSubviews()
          {
              base.LayoutSubviews();
  
              var height = (float)(Bounds.Height / 2);
              UserNameField.Frame = new RectangleF(HorizontalMargin, 0, (float)Bounds.Width - (2 * HorizontalMargin), height);
              PasswordField.Frame = new RectangleF(HorizontalMargin, height, (float)Bounds.Width - (2 * HorizontalMargin), height);
          }
  
          public override void Draw(CGRect rect)
          {
              base.Draw(rect);
  
              var graphicsContext = UIGraphics.GetCurrentContext();
              var height = (float)(Bounds.Height / 2);
  
              graphicsContext.SetLineWidth(0.25f);
              graphicsContext.SetStrokeColor(Layer.BorderColor);
  
              // create some cutout geometry
              var path = new CGPath();
              path.AddLines(new CGPoint[]
                  {
                      new PointF(0, height),
                      new PointF((float)Bounds.Width, height)
                  });
              path.CloseSubpath();
  
              graphicsContext.AddPath(path);
              graphicsContext.DrawPath(CGPathDrawingMode.Stroke);
          }
      }
  
  }
  </code></pre>