From 311337eec92249baaad22e11ead8653551e7af3a Mon Sep 17 00:00:00 2001 From: amddg44 Date: Wed, 31 Jan 2024 13:09:49 +0100 Subject: [PATCH] Update constraints to correctly size footer view height for multiline text --- DuckDuckGo/AutofillSettingsEnableFooterView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DuckDuckGo/AutofillSettingsEnableFooterView.swift b/DuckDuckGo/AutofillSettingsEnableFooterView.swift index 488a53ac4b..1785e0a6d7 100644 --- a/DuckDuckGo/AutofillSettingsEnableFooterView.swift +++ b/DuckDuckGo/AutofillSettingsEnableFooterView.swift @@ -54,10 +54,14 @@ class AutofillSettingsEnableFooterView: UIView { private func installConstraints() { title.translatesAutoresizingMaskIntoConstraints = false + + let bottomConstraint = title.bottomAnchor.constraint(equalTo: self.bottomAnchor, constant: -Constants.defaultPadding) + // setting priority to ensure multiline text is displayed correctly + bottomConstraint.priority = .defaultHigh NSLayoutConstraint.activate([ title.topAnchor.constraint(equalTo: self.topAnchor, constant: Constants.topPadding), - title.bottomAnchor.constraint(equalTo: self.bottomAnchor, constant: -Constants.defaultPadding), + bottomConstraint, title.leadingAnchor.constraint(equalTo: self.leadingAnchor, constant: Constants.defaultPadding), title.trailingAnchor.constraint(lessThanOrEqualTo: self.trailingAnchor, constant: -Constants.defaultPadding) ])