Exemplo n.º 1
0
        private void SetupConstraints()
        {
            ScrollView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();
            _containerView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            View.AddConstraints(
                _containerView.WithSameWidth(View),
                _containerView.Height().EqualTo(UIScreen.MainScreen.Bounds.Height)
                );

            ScrollView.AddConstraints(
                _containerView.AtTopOf(ScrollView),
                _containerView.AtLeftOf(ScrollView),
                _containerView.AtRightOf(ScrollView)
                );

            _containerView.AddConstraints(

                _passwordHeader.AtTopOf(_containerView, 8),
                _passwordHeader.AtLeftOf(_containerView, 14),
                _passwordHeader.AtRightOf(_containerView, 14),

                _passwordContainer.Below(_passwordHeader, 8),
                _passwordContainer.AtLeftOf(_containerView),
                _passwordContainer.AtRightOf(_containerView),

                _passwordTopRuler.AtTopOf(_passwordContainer),
                _passwordTopRuler.AtLeftOf(_passwordContainer),
                _passwordTopRuler.AtRightOf(_passwordContainer),
                _passwordTopRuler.Height().EqualTo(1),

                _oldPasswordHeader.Below(_passwordTopRuler, 18),
                _oldPasswordHeader.AtLeftOf(_passwordContainer, 14),
                _oldPasswordHeader.AtRightOf(_passwordContainer, 14),

                _oldPassword.Below(_oldPasswordHeader, 6),
                _oldPassword.AtLeftOf(_passwordContainer, 14),
                _oldPassword.AtRightOf(_passwordContainer, 14),
                _oldPassword.Height().EqualTo(40),

                _newPasswordHeader.Below(_oldPassword, 18),
                _newPasswordHeader.AtLeftOf(_passwordContainer, 14),
                _newPasswordHeader.AtRightOf(_passwordContainer, 14),

                _newPassword.Below(_newPasswordHeader, 6),
                _newPassword.AtLeftOf(_passwordContainer, 14),
                _newPassword.AtRightOf(_passwordContainer, 14),
                _newPassword.Height().EqualTo(40),

                _confirmPasswordHeader.Below(_newPassword, 18),
                _confirmPasswordHeader.AtLeftOf(_passwordContainer, 14),
                _confirmPasswordHeader.AtRightOf(_passwordContainer, 14),

                _confirmPassword.Below(_confirmPasswordHeader, 6),
                _confirmPassword.AtLeftOf(_passwordContainer, 14),
                _confirmPassword.AtRightOf(_passwordContainer, 14),
                _confirmPassword.Height().EqualTo(40),

                _passwordBottomRuler.Below(_confirmPassword, 18),
                _passwordBottomRuler.AtBottomOf(_passwordContainer),
                _passwordBottomRuler.AtLeftOf(_passwordContainer),
                _passwordBottomRuler.AtRightOf(_passwordContainer),
                _passwordBottomRuler.Height().EqualTo(1)
                );
        }
Exemplo n.º 2
0
        private void SetupConstraints()
        {
            ScrollView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();
            _containerView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            View.AddConstraints(
                _containerView.WithSameWidth(View)
                );

            ScrollView.AddConstraints(
                _containerView.AtTopOf(ScrollView),
                _containerView.AtLeftOf(ScrollView),
                _containerView.AtRightOf(ScrollView),
                _containerView.AtBottomOf(ScrollView)
                );

            _containerView.AddConstraints(
                // Header
                _headerContainer.AtTopOf(_containerView),
                _headerContainer.AtLeftOf(_containerView),
                _headerContainer.AtRightOf(_containerView),

                _backgroundImage.AtLeftOf(_headerContainer),
                _backgroundImage.AtRightOf(_headerContainer),
                _backgroundImage.AtTopOf(_headerContainer),
                _backgroundImage.Height().EqualTo(200),

                _image.WithSameCenterX(_headerContainer),
                _image.AtTopOf(_headerContainer, 150),
                _image.Width().EqualTo(100),
                _image.Height().EqualTo(100),

                _text.Below(_image, 20),
                _text.WithSameCenterX(_image),

                _headerBottomRuler.Below(_text, 30),
                _headerBottomRuler.AtBottomOf(_headerContainer),
                _headerBottomRuler.AtLeftOf(_headerContainer),
                _headerBottomRuler.AtRightOf(_headerContainer),
                _headerBottomRuler.Height().EqualTo(1),

                // Basic information
                _aboutYouHeader.Below(_headerBottomRuler, 15),
                _aboutYouHeader.AtLeftOf(_containerView, 14),
                _aboutYouHeader.AtRightOf(_containerView, 14),

                _aboutYouContainer.Below(_aboutYouHeader, 5),
                _aboutYouContainer.AtLeftOf(_containerView),
                _aboutYouContainer.AtRightOf(_containerView),

                _aboutYouTopRuler.AtTopOf(_aboutYouContainer),
                _aboutYouTopRuler.AtLeftOf(_aboutYouContainer),
                _aboutYouTopRuler.AtRightOf(_aboutYouContainer),
                _aboutYouTopRuler.Height().EqualTo(1),

                _displayNameHeader.Below(_aboutYouTopRuler, 15),
                _displayNameHeader.AtLeftOf(_aboutYouContainer, 14),
                _displayNameHeader.AtRightOf(_aboutYouContainer, 14),

                _displayName.Below(_displayNameHeader, 15),
                _displayName.AtLeftOf(_aboutYouContainer, 14),
                _displayName.AtRightOf(_aboutYouContainer, 14),
                _displayName.Height().EqualTo(40),

                _firstNameHeader.Below(_displayName, 15),
                _firstNameHeader.AtLeftOf(_aboutYouContainer, 14),
                _firstNameHeader.AtRightOf(_aboutYouContainer, 14),

                _firstName.Below(_firstNameHeader, 15),
                _firstName.AtLeftOf(_aboutYouContainer, 14),
                _firstName.AtRightOf(_aboutYouContainer, 14),
                _firstName.Height().EqualTo(40),

                _lastNameHeader.Below(_firstName, 15),
                _lastNameHeader.AtLeftOf(_aboutYouContainer, 14),
                _lastNameHeader.AtRightOf(_aboutYouContainer, 14),

                _lastName.Below(_lastNameHeader, 15),
                _lastName.AtLeftOf(_aboutYouContainer, 14),
                _lastName.AtRightOf(_aboutYouContainer, 14),
                _lastName.Height().EqualTo(40),

                _emailHeader.Below(_lastName, 15),
                _emailHeader.AtLeftOf(_aboutYouContainer, 14),
                _emailHeader.AtRightOf(_aboutYouContainer, 14),

                _email.Below(_emailHeader, 15),
                _email.AtLeftOf(_aboutYouContainer, 14),
                _email.AtRightOf(_aboutYouContainer, 14),
                _email.Height().EqualTo(40),

                _aboutYouBottomRuler.Below(_email, 15),
                _aboutYouBottomRuler.AtBottomOf(_aboutYouContainer),
                _aboutYouBottomRuler.AtLeftOf(_aboutYouContainer),
                _aboutYouBottomRuler.AtRightOf(_aboutYouContainer),
                _aboutYouBottomRuler.Height().EqualTo(1),

                // Profile
                _profileHeader.Below(_aboutYouBottomRuler, 15),
                _profileHeader.AtRightOf(_profileContainer, 14),
                _profileHeader.AtLeftOf(_profileContainer, 14),

                _profileContainer.Below(_profileHeader, 5),
                _profileContainer.AtLeftOf(_containerView),
                _profileContainer.AtRightOf(_containerView),

                _profileTopRuler.AtTopOf(_profileContainer),
                _profileTopRuler.AtLeftOf(_profileContainer),
                _profileTopRuler.AtRightOf(_profileContainer),
                _profileTopRuler.Height().EqualTo(1),

                _shortIntroHeader.Below(_profileTopRuler, 15),
                _shortIntroHeader.AtLeftOf(_profileContainer, 14),
                _shortIntroHeader.AtRightOf(_profileContainer, 14),

                _shortIntro.Below(_shortIntroHeader, 15),
                _shortIntro.AtRightOf(_profileContainer, 14),
                _shortIntro.AtLeftOf(_profileContainer, 14),
                _shortIntro.Height().EqualTo(40),

                _aboutHeader.Below(_shortIntro, 15),
                _aboutHeader.AtLeftOf(_profileContainer, 14),
                _aboutHeader.AtRightOf(_profileContainer, 14),

                _about.Below(_aboutHeader, 15),
                _about.AtRightOf(_profileContainer, 14),
                _about.AtLeftOf(_profileContainer, 14),
                _about.Height().EqualTo(40),

                _cityheader.Below(_about, 15),
                _cityheader.AtLeftOf(_profileContainer, 14),
                _cityheader.AtRightOf(_profileContainer, 14),

                _city.Below(_cityheader, 15),
                _city.AtRightOf(_profileContainer, 14),
                _city.AtLeftOf(_profileContainer, 14),
                _city.Height().EqualTo(40),

                _linkedinHeader.Below(_city, 15),
                _linkedinHeader.AtLeftOf(_profileContainer, 14),
                _linkedinHeader.AtRightOf(_profileContainer, 14),

                _linkedin.Below(_linkedinHeader, 15),
                _linkedin.AtRightOf(_profileContainer, 14),
                _linkedin.AtLeftOf(_profileContainer, 14),
                _linkedin.Height().EqualTo(40),

                _facebookHeader.Below(_linkedin, 15),
                _facebookHeader.AtLeftOf(_profileContainer, 14),
                _facebookHeader.AtRightOf(_profileContainer, 14),

                _facebook.Below(_facebookHeader, 15),
                _facebook.AtRightOf(_profileContainer, 14),
                _facebook.AtLeftOf(_profileContainer, 14),
                _facebook.Height().EqualTo(40),

                _twitterHeader.Below(_facebook, 15),
                _twitterHeader.AtLeftOf(_profileContainer, 14),
                _twitterHeader.AtRightOf(_profileContainer, 14),

                _twitter.Below(_twitterHeader, 15),
                _twitter.AtRightOf(_profileContainer, 14),
                _twitter.AtLeftOf(_profileContainer, 14),
                _twitter.Height().EqualTo(40),

                _googleHeader.Below(_twitter, 15),
                _googleHeader.AtLeftOf(_profileContainer, 14),
                _googleHeader.AtRightOf(_profileContainer, 14),

                _google.Below(_googleHeader, 15),
                _google.AtRightOf(_profileContainer, 14),
                _google.AtLeftOf(_profileContainer, 14),
                _google.Height().EqualTo(40),

                _instagramHeader.Below(_google, 15),
                _instagramHeader.AtLeftOf(_profileContainer, 14),
                _instagramHeader.AtRightOf(_profileContainer, 14),

                _instagram.Below(_instagramHeader, 15),
                _instagram.AtRightOf(_profileContainer, 14),
                _instagram.AtLeftOf(_profileContainer, 14),
                _instagram.Height().EqualTo(40),

                _profileBottomRuler.Below(_instagram, 15),
                _profileBottomRuler.AtBottomOf(_profileContainer),
                _profileBottomRuler.AtLeftOf(_profileContainer),
                _profileBottomRuler.AtRightOf(_profileContainer),
                _profileBottomRuler.Height().EqualTo(1),


                _profileContainer.AtBottomOf(_containerView, 15)

                // Preferences
                //_preferencesHeader.Below(_profileBottomRuler, 15),
                //_preferencesHeader.AtRightOf(_preferencesContainer, 14),
                //_preferencesHeader.AtLeftOf(_preferencesContainer, 14),

                //_preferencesContainer.Below(_preferencesHeader, 5),
                //_preferencesContainer.AtLeftOf(_containerView),
                //_preferencesContainer.AtRightOf(_containerView),
                //_preferencesContainer.AtBottomOf(_containerView, 15),

                //_preferencesTopRuler.AtTopOf(_preferencesContainer),
                //_preferencesTopRuler.AtLeftOf(_preferencesContainer),
                //_preferencesTopRuler.AtRightOf(_preferencesContainer),
                //_preferencesTopRuler.Height().EqualTo(1),

                //_locationHeader.Below(_preferencesTopRuler, 15),
                //_locationHeader.AtLeftOf(_profileContainer, 14),
                //_locationHeader.AtRightOf(_profileContainer, 14),

                //_location.Below(_locationHeader, 15),
                //_location.AtRightOf(_preferencesContainer, 14),
                //_location.AtLeftOf(_preferencesContainer, 14),
                //_location.Height().EqualTo(40),

                //_languageHeader.Below(_location, 15),
                //_languageHeader.AtLeftOf(_profileContainer, 14),
                //_languageHeader.AtRightOf(_profileContainer, 14),

                //_language.Below(_languageHeader, 15),
                //_language.AtRightOf(_preferencesContainer, 14),
                //_language.AtLeftOf(_preferencesContainer, 14),
                //_language.Height().EqualTo(40),

                //_preferencesBottomRuler.Below(_language, 15),
                //_preferencesBottomRuler.AtBottomOf(_preferencesContainer),
                //_preferencesBottomRuler.AtLeftOf(_preferencesContainer),
                //_preferencesBottomRuler.AtRightOf(_preferencesContainer),
                //_preferencesBottomRuler.Height().EqualTo(1)
                );
        }