diff --git a/VDS/Components/TileContainer/TileContainer.swift b/VDS/Components/TileContainer/TileContainer.swift index 1d415393..61b91eaf 100644 --- a/VDS/Components/TileContainer/TileContainer.swift +++ b/VDS/Components/TileContainer/TileContainer.swift @@ -239,12 +239,12 @@ open class TileContainerBase: Control where Padding heightConstraint = layoutGuide.heightAnchor.constraint(equalToConstant: 0) - backgroundImageView - .pinTop(layoutGuide.topAnchor) - .pinLeading(layoutGuide.leadingAnchor) - .pinTrailing(layoutGuide.trailingAnchor) - .pinBottom(layoutGuide.bottomAnchor, 0, .defaultLow) + backgroundImageView.pinToSuperView() + backgroundImageView.setContentHuggingPriority(.defaultLow, for: .horizontal) + backgroundImageView.setContentHuggingPriority(.defaultLow, for: .vertical) + backgroundImageView.setContentCompressionResistancePriority(.defaultLow, for: .horizontal) + backgroundImageView.setContentCompressionResistancePriority(.defaultLow, for: .vertical) backgroundImageView.isUserInteractionEnabled = false backgroundImageView.isHidden = true @@ -286,15 +286,6 @@ open class TileContainerBase: Control where Padding highlightView.backgroundColor = hightLightViewColorConfiguration.getColor(self) highlightView.isHidden = !isHighlighted - if let backgroundImage { - backgroundImageView.image = backgroundImage - backgroundImageView.isHidden = false - backgroundColor = imageFallbackColorConfiguration.getColor(self) - } else { - backgroundImageView.isHidden = true - backgroundColor = backgroundColorConfiguration.getColor(self) - } - layer.borderColor = borderColorConfiguration.getColor(self).cgColor layer.borderWidth = showBorder ? VDSFormControls.borderWidth : 0