private void SetupConstraints()
        {
            ContentView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            ContentView.AddConstraints(
                ContentView.Height().EqualTo(300),

                _backPanelView.AtTopOf(ContentView, 20),
                _backPanelView.AtLeftOf(ContentView, 20),
                _backPanelView.AtRightOf(ContentView, 20),
                _backPanelView.AtBottomOf(ContentView, 20),

                _horizontalLine.WithSameCenterY(_backPanelView),
                _horizontalLine.AtLeftOf(_backPanelView, 10),
                _horizontalLine.AtRightOf(_backPanelView, 10),
                _horizontalLine.Height().EqualTo(1),

                _verticalLine.WithSameCenterX(_backPanelView),
                _verticalLine.AtTopOf(_backPanelView, 10),
                _verticalLine.AtBottomOf(_backPanelView, 10),
                _verticalLine.Width().EqualTo(1),

                _membersButton.AtTopOf(_backPanelView),
                _membersButton.AtLeftOf(_backPanelView),
                _membersButton.AtRightOf(_verticalLine),
                _membersButton.Above(_horizontalLine),

                _eventsButton.AtTopOf(_backPanelView),
                _eventsButton.AtRightOf(_backPanelView),
                _eventsButton.AtLeftOf(_verticalLine),
                _eventsButton.Above(_horizontalLine),

                _groupsButton.AtBottomOf(_backPanelView),
                _groupsButton.AtLeftOf(_backPanelView),
                _groupsButton.AtRightOf(_verticalLine),
                _groupsButton.Below(_horizontalLine),

                _infoButton.AtBottomOf(_backPanelView),
                _infoButton.AtRightOf(_backPanelView),
                _infoButton.AtLeftOf(_verticalLine),
                _infoButton.Below(_horizontalLine)
                );
        }
示例#2
0
        private void SetupConstraints()
        {
            ContentView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            ContentView.AddConstraints(
                _backPanelView.AtTopOf(ContentView, 20).WithIdentifier("BackPanelViewAtTopOf"),
                _backPanelView.AtLeftOf(ContentView, 20).WithIdentifier("BackPanelViewAtLeftOf"),
                _backPanelView.AtRightOf(ContentView, 20).WithIdentifier("BackPanelViewAtRightOf"),
                _backPanelView.AtBottomOf(ContentView, 20).WithIdentifier("BackPanelViewAtBottomOf"),

                _logo.AtTopOf(_backPanelView, 20).WithIdentifier("LogoAtTopOfBackPanel"),
                _logo.AtLeftOf(_backPanelView, 20).WithIdentifier("LogoAtLeftOrBackPanel"),
                _logo.Height().EqualTo().WidthOf(_logo).WithIdentifier("LogoHeightEqualToWidthLogo"),
                _logo.Width().EqualTo(80).WithIdentifier("LogoWdthEqualTo"),

                _name.ToRightOf(_logo, 20).WithIdentifier("NameToRightOfLogo"),
                _name.WithSameTop(_logo).Plus(2).WithIdentifier("NameWithSameTopLogo"),
                _name.AtRightOf(_backPanelView, 20).WithIdentifier("NameAtRightOfBackPanel"),

                _industry.Below(_name).WithIdentifier("IndustryBelowName"),
                _industry.WithSameLeft(_name).WithIdentifier("IndustryWithSameLeftName"),
                _industry.WithSameRight(_name).WithIdentifier("IndustrySameRightName"),
                _industry.Height().EqualTo(25).WithIdentifier("IndustryHeightEqualTo"),

                _horizontalLine.Below(_logo, 20).WithIdentifier("HorizontalLineBelowLogo"),
                _horizontalLine.Height().EqualTo(1).WithIdentifier("HorzontalLineHeightEqualTo"),
                _horizontalLine.WithSameLeft(_logo).WithIdentifier("HorizontalLineWithSameLeftLogo"),
                _horizontalLine.WithSameRight(_name).WithIdentifier("HorizontalLineSameRightName"),

                _numberOfCoworkers.Below(_horizontalLine, 5).WithIdentifier("NumberCoworkersBelowHorizontalLine"),
                _numberOfCoworkers.WithSameLeft(_horizontalLine).WithIdentifier("NumberCoworkersSameLeftHorizontalLine"),

                _usersCollection.Below(_horizontalLine, 5).WithIdentifier("UserCollBelowHorizontalLine"),
                _usersCollection.WithSameLeft(_logo).WithIdentifier("UserCollSameLeftLogo"),
                _usersCollection.WithSameRight(_industry).WithIdentifier("UserCollSameRightIndustry"),
                _usersCollection.AtBottomOf(_backPanelView, 5).WithIdentifier("UserCollBottomBackPanel"),
                _usersCollection.Height().EqualTo(30).WithIdentifier("UserCollHeightEqualTo")
                );
        }