Fix multi-line photo picker permissions label

This commit is contained in:
Elaine 2025-04-03 16:30:37 -06:00 committed by GitHub
parent 7491205353
commit ce833bd48d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,18 +57,22 @@ class LimitedPhotoPermissionsView: UIView {
let label = UILabel()
label.textColor = UIColor.Signal.secondaryLabel
label.font = .dynamicTypeBody2Clamped
label.numberOfLines = 2
label.setContentHuggingHorizontalLow()
label.text = OWSLocalizedString(
"ATTACHMENT_KEYBOARD_LIMITED_ACCESS",
comment: "Text in chat attachment panel when Signal only has access to some photos/videos. This string is in a compact horizontal space, so it should be short if possible."
)
addSubview(label)
label.autoPinEdges(toSuperviewMarginsExcludingEdge: .trailing)
label.setContentHuggingLow()
addSubview(button)
button.autoPinEdges(toSuperviewMarginsExcludingEdge: .leading)
button.autoPinEdge(.leading, to: .trailing, of: label, withOffset: 8)
button.setContentHuggingHigh()
button.setCompressionResistanceHorizontalHigh()
let stackView = UIStackView(arrangedSubviews: [label, button])
stackView.axis = .horizontal
stackView.spacing = 8
stackView.alignment = .center
self.addSubview(stackView)
stackView.autoPinEdgesToSuperviewMargins()
}
required init?(coder: NSCoder) {