Ejemplo n.º 1
0
        public override void UpdateConstraints()
        {
            if (!_constraintsCreated)
            {
                ContentView.AddConstraints(
                    _imageControl.WithSameCenterY(ContentView),
                    _imageControl.WithSameCenterX(ContentView),
                    _imageControl.Width().EqualTo(55f),
                    _imageControl.Height().EqualTo(55f)
                    );

                _constraintsCreated = true;
            }

            base.UpdateConstraints();
        }
Ejemplo n.º 2
0
        public override void UpdateConstraints()
        {
            var margin = 10f;

            if (!_constraintsCreated)
            {
                ContentView.AddConstraints(
                    _imageControl.AtLeftOfSafeArea(ContentView, 2 * margin),
                    _imageControl.AtTopOfSafeArea(ContentView, margin),
                    _imageControl.AtBottomOfSafeArea(ContentView, margin),
                    _imageControl.Width().EqualTo(100f),
                    _imageControl.Height().EqualTo(100f),

                    _labelWelcome.ToRightOf(_imageControl, margin),
                    _labelWelcome.AtRightOfSafeArea(ContentView, 2 * margin),
                    _labelWelcome.WithSameCenterY(_imageControl)
                    );

                _constraintsCreated = true;
            }

            base.UpdateConstraints();
        }