예제 #1
0
        public static ConstraintGroup Constrain(UIView view1, UIView view2, UIView view3, UIView view4, UIView view5, UIView view6, Action <LayoutProxy, LayoutProxy, LayoutProxy, LayoutProxy, LayoutProxy, LayoutProxy> closure, ConstraintGroup group = null)
        {
            var context = new Context();

            group = group ?? new ConstraintGroup();

            closure(
                new LayoutProxy(context, view1),
                new LayoutProxy(context, view2),
                new LayoutProxy(context, view3),
                new LayoutProxy(context, view4),
                new LayoutProxy(context, view5),
                new LayoutProxy(context, view6)
                );
            group.ReplaceConstraints(context.Constraints);

            return(group);
        }
예제 #2
0
        public static ConstraintGroup Constrain(UIView view, Action <LayoutProxy> closure, ConstraintGroup group = null)
        {
            var context = new Context();

            group = group ?? new ConstraintGroup();

            closure(new LayoutProxy(context, view));
            group.ReplaceConstraints(context.Constraints);

            return(group);
        }
예제 #3
0
        public static ConstraintGroup Constrain(UIView[] views, Action <LayoutProxy[]> closure, ConstraintGroup group = null)
        {
            var context = new Context();

            group = group ?? new ConstraintGroup();
            var proxies = views.Select(x => new LayoutProxy(context, x)).ToArray();

            closure(proxies);
            group.ReplaceConstraints(context.Constraints);

            return(group);
        }
예제 #4
0
 public static void ClearConstrains(ConstraintGroup group)
 {
     group.ReplaceConstraints(Array.Empty <Constraint>());
 }