 
         self.contentView.addSubview(self.nameLabel)
         self.contentView.addSubview(self.valueField)
+
+        self.nameLabel.addConstraint(self.nameLabelWidthConstraint)
+        self.nameLabel.addConstraint(forHeight: 50)
+        self.resetConstraints()
     }
 
     required init?(coder aDecoder: NSCoder) {
         fatalError("init(coder:) has not been implemented")
-    }
-
-    fileprivate override func layoutSubviews() {
-        super.layoutSubviews()
-
-        self.nameLabel.frame = CGRect(x: 8, y: 2, width: self.nameLabelWidth, height: self.contentView.bounds.height - 4)
-        var valueFieldWidth = self.contentView.bounds.width - self.nameLabel.frame.maxX - 16
-
-        if let button = self.clearButton {
-            valueFieldWidth -= self.contentView.bounds.height + self.buttonSize
-
-            button.frame = CGRect(
-                x: self.contentView.bounds.width - 44,
-                y: (self.contentView.bounds.height - self.buttonSize) / 2,
-                width: self.buttonSize,
-                height: self.buttonSize
-            )
-        }
-
-        self.valueField.frame = CGRect(
-            x: self.nameLabel.frame.maxX + 8,
-            y: self.nameLabel.frame.minY,
-            width: valueFieldWidth,
-            height: self.nameLabel.frame.height
-        )
     }
 
     func set(clearCallback: @escaping (UIButton) -> ()) {

        return self.contentView.bounds.height
    }

    let nameLabel = UILabel()
    let valueField = UITextField()
    private(set) var clearButton: RoundedBorderButton?
    var nameLabelWidth: CGFloat = 100

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)

        self.nameLabel.font = FormViewController.font

    func resetClearCallback() {
        self.clearButton?.removeFromSuperview()
        self.clearButton = nil
    }

    func resetConstraints() {
        self.contentView.removeConstraints(self.contentView.constraints)

        self.contentView.addConstraints([
            NSLayoutConstraint(topOf: self.nameLabel, to: self.contentView, distance: 2),
            NSLayoutConstraint(verticalCenterOf: self.nameLabel, to: self.contentView),
            NSLayoutConstraint(leftOf: self.nameLabel, to: self.contentView, distance: 8),

            NSLayoutConstraint(leftOf: self.valueField, toRightOf: self.nameLabel, distance: 8),
            NSLayoutConstraint(topOf: self.valueField, to: self.nameLabel),
            NSLayoutConstraint(bottomOf: self.valueField, to: self.nameLabel),
        ])

        if let button = self.clearButton {
            self.contentView.addConstraints([
                NSLayoutConstraint(rightOf: self.valueField, to: button, distance: 8),
                NSLayoutConstraint(topOf: button, to: self.nameLabel),
                NSLayoutConstraint(bottomOf: button, to: self.nameLabel),
                NSLayoutConstraint(rightOf: button, to: self.contentView, distance: 8),
            ])
        }
        else {
            self.contentView.addConstraints([
                NSLayoutConstraint(rightOf: self.valueField, to: self.contentView, distance: 8),
            ])
        }
    }

    override func prepareForReuse() {
