mirror of
https://github.com/metabolist/metatext.git
synced 2024-11-22 08:10:59 +00:00
Fix poll button
This commit is contained in:
parent
b7f792a7d7
commit
483f519f4b
1 changed files with 4 additions and 5 deletions
|
@ -12,7 +12,6 @@ final class PollOptionButton: UIButton {
|
|||
titleLabel?.numberOfLines = 0
|
||||
titleLabel?.lineBreakMode = .byWordWrapping
|
||||
contentHorizontalAlignment = .leading
|
||||
titleEdgeInsets = Self.titleEdgeInsets
|
||||
|
||||
let attributedTitle = NSMutableAttributedString(string: title)
|
||||
|
||||
|
@ -32,6 +31,10 @@ final class PollOptionButton: UIButton {
|
|||
|
||||
setContentCompressionResistancePriority(.required, for: .vertical)
|
||||
|
||||
imageView?.translatesAutoresizingMaskIntoConstraints = false
|
||||
imageView?.widthAnchor.constraint(greaterThanOrEqualToConstant: .minimumButtonDimension).isActive = true
|
||||
imageView?.contentMode = .scaleAspectFit
|
||||
|
||||
heightAnchor.constraint(equalTo: titleLabel!.heightAnchor).isActive = true
|
||||
}
|
||||
|
||||
|
@ -46,7 +49,3 @@ extension PollOptionButton {
|
|||
title.height(width: width, font: .preferredFont(forTextStyle: .callout))
|
||||
}
|
||||
}
|
||||
|
||||
private extension PollOptionButton {
|
||||
static let titleEdgeInsets = UIEdgeInsets(top: 0, left: .defaultSpacing, bottom: 0, right: .compactSpacing)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue