private static NSLayoutConstraint GetZeroConstraint(UIView view, NSLayoutAttribute attribute) { Tuple <NSLayoutConstraint, bool> result = FindOrCreateConstraint(view, attribute); NSLayoutConstraint constraint = result.Item1; bool didCreateConstraint = result.Item2; constraint.Clear(didCreateConstraint); return(constraint); }
private static void ClearConstraint(UIView view, NSLayoutAttribute attribute) { NSLayoutConstraint constraint = GetConstraint(view, view.Superview, attribute); constraint?.Clear(false); }