예제 #1
0
        private void DecorTextFields(UITextField textField)
        {
            var tag = textField.Tag;

            var previousView = _textFieldList.FirstOrDefault((x) => x.Tag == tag - 1);

            this.AddSubview(textField);

            if (tag == 0)
            {
                this.AddConstraints(
                    textField.AtTopOf(this),
                    textField.AtLeftOf(this),
                    textField.AtBottomOf(this),
                    textField.Width().EqualTo((this.Bounds.Width - (_pinLength - 1) * TEXT_MARGIN) / _pinLength)
                    );
            }
            else
            {
                this.AddConstraints(
                    textField.AtTopOf(this),
                    textField.ToRightOf(previousView, TEXT_MARGIN),
                    textField.AtBottomOf(this),
                    textField.Width().EqualTo((this.Bounds.Width - (_pinLength - 1) * TEXT_MARGIN) / _pinLength)
                    );
            }
        }