Skip to content

Commit

Permalink
Update constraints to correctly size footer view height for multiline…
Browse files Browse the repository at this point in the history
… text
  • Loading branch information
amddg44 committed Jan 31, 2024
1 parent 5dbcc43 commit 311337e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion DuckDuckGo/AutofillSettingsEnableFooterView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
])
Expand Down

0 comments on commit 311337e

Please sign in to comment.