From ce833bd48d407100c18494ec495083ea490395ca Mon Sep 17 00:00:00 2001 From: Elaine <138257830+elaine-signal@users.noreply.github.com> Date: Thu, 3 Apr 2025 16:30:37 -0600 Subject: [PATCH] Fix multi-line photo picker permissions label --- .../LimitedPhotoPermissionsView.swift | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Signal/src/ViewControllers/Attachment Keyboard/LimitedPhotoPermissionsView.swift b/Signal/src/ViewControllers/Attachment Keyboard/LimitedPhotoPermissionsView.swift index 457a252552..0b7c497348 100644 --- a/Signal/src/ViewControllers/Attachment Keyboard/LimitedPhotoPermissionsView.swift +++ b/Signal/src/ViewControllers/Attachment Keyboard/LimitedPhotoPermissionsView.swift @@ -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) {