예제 #1
0
        private void SetupConstraints()
        {
            ContentView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            _buttonCenterConstraint = _viewButton.WithSameCenterX(ContentView).ToLayoutConstraints().First();
            _buttonRightConstraint  = _viewButton.AtRightOf(ContentView, 14).ToLayoutConstraints().First();

            ContentView.AddConstraints(
                _background.AtLeftOf(ContentView),
                _background.AtRightOf(ContentView),
                _background.AtTopOf(ContentView),
                _background.AtBottomOf(ContentView),

                _name.AtLeftOf(ContentView, 14),
                _name.AtRightOf(ContentView, 14),
                _name.AtTopOf(ContentView, 30),

                GroupDescription.Below(_name, 14),
                GroupDescription.AtLeftOf(ContentView, 14),
                GroupDescription.AtRightOf(ContentView, 14),

                _viewButton.AtBottomOf(ContentView, 25),
                _viewButton.Width().EqualTo(130),
                _viewButton.Height().EqualTo(40),

                _ruler.AtBottomOf(ContentView),
                _ruler.AtLeftOf(ContentView),
                _ruler.AtRightOf(ContentView),
                _ruler.Height().EqualTo(1)
                );
        }
예제 #2
0
        private void SetupConstraints()
        {
            ContentView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            ContentView.AddConstraints(
                _background.AtTopOf(ContentView),
                _background.AtLeftOf(ContentView),
                _background.AtRightOf(ContentView),
                _background.AtBottomOf(ContentView, 5),

                _title.WithSameCenterY(ContentView),
                _title.AtLeftOf(ContentView, 14),
                _title.AtRightOf(ContentView, 14)
                );
        }
예제 #3
0
        private void SetupConstraints()
        {
            ContentView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            ContentView.AddConstraints(
                _background.AtLeftOf(ContentView).WithIdentifier("BackgroundAtLeftOfContentView"),
                _background.AtRightOf(ContentView).WithIdentifier("BackgroundAtRightOfContentView"),
                _background.AtTopOf(ContentView).WithIdentifier("BackgroundAtTopOfContentView"),
                _background.AtBottomOf(ContentView, 2).WithIdentifier("BackgroundAtBottomOfContentView"),

                _dateBackPanel.AtTopOf(ContentView, 20).WithIdentifier("DateBackPanelAtTopOfContentView"),
                _dateBackPanel.AtRightOf(ContentView, 20).WithIdentifier("DateBackPanelAtRightOfContentView"),
                _dateBackPanel.Width().EqualTo(90).WithIdentifier("DateBackPanelWidth"),
                _dateBackPanel.Height().EqualTo(25).WithIdentifier("DateBackPanelHeight"),

                _date.WithSameCenterY(_dateBackPanel).WithIdentifier("DateAtRightOfContentView"),
                _date.WithSameCenterX(_dateBackPanel).WithIdentifier("DateAtBottomOfContentView"),

                _infoContainerPlaceholder.AtTopOf(_background),
                _infoContainerPlaceholder.AtLeftOf(_background),
                _infoContainerPlaceholder.AtRightOf(_background),
                _infoContainerPlaceholder.AtBottomOf(_background),

                _infoContainer.AtLeftOf(_infoContainerPlaceholder).WithIdentifier("InfoContainerAtLeftOfBackground"),
                _infoContainer.AtRightOf(_infoContainerPlaceholder).WithIdentifier("InforContainerAtRightOfBackground"),
                _infoContainer.WithSameCenterY(_infoContainerPlaceholder),

                _name.AtLeftOf(_infoContainer, 20).WithIdentifier("NameAtLeftOfBackgorund"),
                _name.AtRightOf(_infoContainer, 20).WithIdentifier("NameAtRightBackground"),
                _name.AtTopOf(_infoContainer, 4),

                _time.Below(_name, 5).WithIdentifier("TimeAboveLocation"),
                _time.AtLeftOf(_infoContainer, 20).WithIdentifier("TimeAtLeftOfBackground"),
                _time.AtRightOf(_infoContainer, 20).WithIdentifier("TimeAtRightOfBackground"),

                _location.Below(_time, 3),
                _location.AtBottomOf(_infoContainer),
                _location.AtLeftOf(_infoContainer, 20),
                _location.AtRightOf(_infoContainer, 20)
                );
        }
        private void SetupConstraints()
        {
            ContentView.SubviewsDoNotTranslateAutoresizingMaskIntoConstraints();

            ContentView.AddConstraints(
                _backpanel.AtTopOf(ContentView, 5),
                _backpanel.AtLeftOf(ContentView),
                _backpanel.AtRightOf(ContentView),
                _backpanel.AtBottomOf(ContentView),

                _topBorder.AtTopOf(_backpanel),
                _topBorder.AtLeftOf(_backpanel),
                _topBorder.AtRightOf(_backpanel),
                _topBorder.Height().EqualTo(1),

                _background1.AtTopOf(_backpanel, 7),
                _background1.AtLeftOf(_backpanel, 14),
                _background1.AtBottomOf(_backpanel, 0),

                _title1.WithSameCenterX(_background1),
                _title1.WithSameCenterY(_background1),
                _title1.WithSameRight(_background1),
                _title1.WithSameLeft(_background1),

                _background2.AtTopOf(_backpanel, 7),
                _background2.AtRightOf(_backpanel, 14),
                _background2.AtBottomOf(_backpanel, 0),
                _background2.WithSameWidth(_background1),
                _background2.ToRightOf(_background1, 7),

                _title2.WithSameCenterX(_background2),
                _title2.WithSameRight(_background2),
                _title2.WithSameLeft(_background2),
                _title2.WithSameCenterY(_background2)
                );
        }