forked from shadowfacts/Tusker
parent
e745d78d67
commit
b51c1c03cb
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue