private void AddDebugPair(string labelText, string labelValue = null) { UILabel label = new UILabel(labelText); UILabel value = new UILabel(labelValue); label.AddConstraint(Edge.Left, this, Edge.Left, 5); value.AddConstraint(Edge.Left, this, Edge.Left, 140); if (previousAnchor == null) { label.AddConstraint(Edge.Top, this, Edge.Top, 5); value.AddConstraint(Edge.Top, this, Edge.Top, 5); } else { label.AddConstraint(Edge.Top, previousAnchor, Edge.Bottom); value.AddConstraint(Edge.Top, previousAnchor, Edge.Bottom); } previousAnchor = label; valueLabels.Add(labelText, value); AddChild(label); AddChild(value); if (!SuspendLayout) { label.SuspendLayout = false; value.SuspendLayout = false; label.DoLayout(); value.DoLayout(); } }
public void SetStaticLabel(string labelText) { UILabel label = new UILabel(labelText); label.AddConstraint(Edge.Left, this, Edge.Left, 5); if (previousAnchor == null) { label.AddConstraint(Edge.Top, this, Edge.Top, 5 - nextYOffset); } else { label.AddConstraint(Edge.Top, previousAnchor, Edge.Bottom, nextYOffset); } nextYOffset = 0; previousAnchor = label; AddChild(label); if (!SuspendLayout) { label.DoLayout(); } }
private void AddDebugPair(string labelText, string labelValue = null) { UILabel label = new UILabel(labelText); UILabel value = new UILabel(labelValue); label.AddConstraint(Edge.Left, this, Edge.Left, 5); value.AddConstraint(Edge.Left, this, Edge.Left, 140); if (previousAnchor == null) { label.AddConstraint(Edge.Top, this, Edge.Top, 5 - nextYOffset); value.AddConstraint(Edge.Top, this, Edge.Top, 5 - nextYOffset); } else { label.AddConstraint(Edge.Top, previousAnchor, Edge.Bottom, nextYOffset); value.AddConstraint(Edge.Top, previousAnchor, Edge.Bottom, nextYOffset); } nextYOffset = 0; previousAnchor = label; valueLabels.Add(labelText, value); AddChild(label); AddChild(value); if (!SuspendLayout) { label.DoLayout(); value.DoLayout(); } }