public override void ViewDidLayoutSubviews () { base.ViewDidLayoutSubviews (); // Perform any additional setup after loading the view, typically from a nib. CGRect bounds = new CGRect(){ Size = this.View.Bounds.Size }; CGRect contentRect = new UIEdgeInsets(){ Top= this.TopLayoutGuide.Length, Bottom = this.BottomLayoutGuide.Length }.InsetRect(bounds); float pad = 20.0f; this.textField.Frame = contentRect.Inset( pad, pad); }
public override void ViewDidLayoutSubviews() { base.ViewDidLayoutSubviews(); // Perform any additional setup after loading the view, typically from a nib. CGRect bounds = new CGRect() { Size = this.View.Bounds.Size }; CGRect contentRect = new UIEdgeInsets() { Top = this.TopLayoutGuide.Length, Bottom = this.BottomLayoutGuide.Length }.InsetRect(bounds); float pad = 20.0f; this.textField.Frame = contentRect.Inset(pad, pad); }