Example #1
0
        protected override void SetupLayoutConstraints()
        {
            base.SetupLayoutConstraints();

            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            this.AddConstraints(BackgroundImage.FullSizeOf(this));

            this.AddConstraints(
                InvalidCredentialsLabel.WithSameLeft(LoginTextField),
                InvalidCredentialsLabel.WithSameRight(LoginTextField),
                InvalidCredentialsLabel.Height().EqualTo(AppDimens.DefaultErrorMessageHeight),
                InvalidCredentialsLabel.Above(LoginTextField, AppDimens.Inset3X));

            this.AddConstraints(
                LoginTextField.AtLeftOf(this, AppDimens.Inset5X),
                LoginTextField.AtRightOf(this, AppDimens.Inset5X),
                LoginTextField.Height().EqualTo(AppDimens.DefaultTextFieldHeight),
                LoginTextField.Above(PasswordTextField, AppDimens.Inset2X));

            this.AddConstraints(
                PasswordTextField.WithSameLeft(LoginTextField),
                PasswordTextField.WithSameCenterY(this),
                PasswordTextField.WithSameRight(LoginTextField),
                PasswordTextField.Height().EqualTo(AppDimens.DefaultTextFieldHeight));

            this.AddConstraints(
                LoginButton.AtLeftOf(this, AppDimens.Inset8X),
                LoginButton.AtRightOf(this, AppDimens.Inset8X),
                LoginButton.Below(PasswordTextField, AppDimens.Inset2X),
                LoginButton.Height().EqualTo(AppDimens.DefaultButtonHeight));
        }
Example #2
0
        protected override void SetupLayoutConstraints()
        {
            base.SetupLayoutConstraints();

            this.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            this.AddConstraints(
                BackgroundView.FullSizeOf(this));

            this.AddConstraints(
                InvalidCredentialLabel.AtLeftOf(this, AppDimens.Inset6X),
                InvalidCredentialLabel.AtRightOf(this, AppDimens.Inset6X),
                InvalidCredentialLabel.Height().EqualTo(AppDimens.Inset8X),
                InvalidCredentialLabel.Above(LoginTextField, AppDimens.Inset4X));

            this.AddConstraints(
                LoginTextField.AtLeftOf(this, AppDimens.Inset6X),
                LoginTextField.AtRightOf(this, AppDimens.Inset6X),
                LoginTextField.Height().EqualTo(AppDimens.Inset6X),
                LoginTextField.Above(PasswordTextField, AppDimens.Inset2X));

            this.AddConstraints(
                PasswordTextField.WithSameLeft(LoginTextField),
                PasswordTextField.WithSameRight(LoginTextField),
                PasswordTextField.Height().EqualTo(AppDimens.Inset6X),
                PasswordTextField.WithSameCenterY(this));

            this.AddConstraints(
                LoginButton.WithSameLeft(LoginTextField),
                LoginButton.Below(PasswordTextField, AppDimens.Inset2X),
                LoginButton.WithSameRight(LoginTextField),
                LoginButton.Height().EqualTo(AppDimens.Inset6X));

            this.AddConstraints(
                ActivityIndicatorView.WithSameCenterX(this),
                ActivityIndicatorView.WithSameCenterY(this));
        }