private AutoLayoutContentView(string name, AutoLayoutContentView parent, UIColor color, String font, float x = 10, float y = 10, float width = 10, float height = 10) { Font = font; OurConstraints = new AutoLayoutConstraints(); Parent = parent; base.BackgroundColor = color; Name = name; base.TranslatesAutoresizingMaskIntoConstraints = false; if (parent == null) { base.Frame = new RectangleF(0, 0, (float)UIScreen.MainScreen.Bounds.Width, (float)UIScreen.MainScreen.Bounds.Height); } else { base.Frame = new RectangleF(x, y, width, height); // Is this still required? } if (parent != null) { parent.Add(this); Parent.OurConstraints.ViewNames.Add(new NSString(Name)); Parent.OurConstraints.Views.Add(this); } // Add to ourself as well. OurConstraints.ViewNames.Add(new NSString(Name)); OurConstraints.Views.Add(this); }
private AutoLayoutContentView(string name, AutoLayoutContentView parent, UIColor color, String font, float x = 10, float y = 10, float width = 10, float height = 10) { Font = font; OurConstraints = new AutoLayoutConstraints (); Parent = parent; base.BackgroundColor = color; Name = name; base.TranslatesAutoresizingMaskIntoConstraints = false; if (parent == null) { base.Frame = new RectangleF (0, 0, (float)UIScreen.MainScreen.Bounds.Width, (float)UIScreen.MainScreen.Bounds.Height); } else { base.Frame = new RectangleF (x, y, width, height);// Is this still required? } if (parent != null) { parent.Add (this); Parent.OurConstraints.ViewNames.Add (new NSString (Name)); Parent.OurConstraints.Views.Add (this); } // Add to ourself as well. OurConstraints.ViewNames.Add (new NSString (Name)); OurConstraints.Views.Add (this); }