diff --git a/Tusker/Views/Poll/PollOptionView.swift b/Tusker/Views/Poll/PollOptionView.swift index bf5e5467..d902244a 100644 --- a/Tusker/Views/Poll/PollOptionView.swift +++ b/Tusker/Views/Poll/PollOptionView.swift @@ -30,6 +30,7 @@ class PollOptionView: UIView { let label = EmojiLabel() label.translatesAutoresizingMaskIntoConstraints = false label.numberOfLines = 0 + label.font = .preferredFont(forTextStyle: .callout) label.text = option.title label.setEmojis(poll.emojis, identifier: poll.id) addSubview(label) @@ -37,7 +38,10 @@ class PollOptionView: UIView { let percentLabel = UILabel() percentLabel.translatesAutoresizingMaskIntoConstraints = false percentLabel.text = "100%" + percentLabel.font = label.font percentLabel.isHidden = true + percentLabel.setContentCompressionResistancePriority(.required, for: .horizontal) + percentLabel.setContentHuggingPriority(.required, for: .horizontal) addSubview(percentLabel) if (poll.voted ?? false) || poll.effectiveExpired, @@ -76,7 +80,7 @@ class PollOptionView: UIView { label.topAnchor.constraint(equalTo: topAnchor), label.bottomAnchor.constraint(equalTo: bottomAnchor), label.leadingAnchor.constraint(equalTo: checkbox.trailingAnchor, constant: 8), - label.trailingAnchor.constraint(equalTo: percentLabel.leadingAnchor), + label.trailingAnchor.constraint(equalTo: percentLabel.leadingAnchor, constant: -4), percentLabel.topAnchor.constraint(equalTo: topAnchor), percentLabel.bottomAnchor.constraint(equalTo: bottomAnchor),